From 576a1215902a070aa74fc4316b3ac0f91a0be4ac Mon Sep 17 00:00:00 2001 From: "Garrett W." Date: Sun, 27 Jul 2025 18:06:58 +0000 Subject: [PATCH 01/23] created basic devcontainer config --- .devcontainer/devcontainer.json | 35 +++++++++++++++++++++++++++++++++ .github/dependabot.yml | 12 +++++++++++ 2 files changed, 47 insertions(+) create mode 100644 .devcontainer/devcontainer.json create mode 100644 .github/dependabot.yml diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000000..fbbd8c68d0e6 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,35 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/php +{ + "name": "PHP", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/php:1-8.4-bullseye", + + // Features to add to the dev container. More info: https://containers.dev/features. + "features": { + "ghcr.io/devcontainers/features/git-lfs:1": {}, + "ghcr.io/devcontainers/features/github-cli:1": {} + }, + + // Configure tool-specific properties. + "customizations": { + // Configure properties specific to VS Code. + "vscode": { + "extensions": [ + "editorconfig.editorconfig", + "ms-vscode.makefile-tools" + ] + } + }, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + "forwardPorts": [ + 8080 + ] + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html" + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000000..f33a02cd16e4 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for more information: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates +# https://containers.dev/guide/dependabot + +version: 2 +updates: + - package-ecosystem: "devcontainers" + directory: "/" + schedule: + interval: weekly From 3aa26a7cc1008f370ebfdf76b7d1e9dfbee9a368 Mon Sep 17 00:00:00 2001 From: "Garrett W." Date: Mon, 28 Jul 2025 18:28:28 +0000 Subject: [PATCH 02/23] fully automated devcontainer integration --- .devcontainer/configure-apache.sh | 14 ++++++++++++++ .devcontainer/devcontainer.json | 10 ++++++++-- .devcontainer/post-create.sh | 4 ++++ .docker/Dockerfile | 7 ++++--- Makefile | 6 ++++++ 5 files changed, 36 insertions(+), 5 deletions(-) create mode 100755 .devcontainer/configure-apache.sh create mode 100755 .devcontainer/post-create.sh diff --git a/.devcontainer/configure-apache.sh b/.devcontainer/configure-apache.sh new file mode 100755 index 000000000000..b6fc4d7c8644 --- /dev/null +++ b/.devcontainer/configure-apache.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +if [ -z "$1" ] || [ ! -d "$1" ]; then + echo "Usage: $0 " + exit +fi + +sudo rm -rf /var/www/html +sudo chmod a+x "$1" +sudo ln -s "$1" /var/www/html && \ + echo "Apache web root directory set to $1" +if ! pgrep -x "apache2" > /dev/null; then + apache2ctl start +fi diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index fbbd8c68d0e6..8cfc860a93ce 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -7,6 +7,7 @@ // Features to add to the dev container. More info: https://containers.dev/features. "features": { + "ghcr.io/devcontainers/features/docker-in-docker:2": {}, "ghcr.io/devcontainers/features/git-lfs:1": {}, "ghcr.io/devcontainers/features/github-cli:1": {} }, @@ -25,10 +26,15 @@ // Use 'forwardPorts' to make a list of ports inside the container available locally. "forwardPorts": [ 8080 - ] + ], // Use 'postCreateCommand' to run commands after the container is created. - // "postCreateCommand": "sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html" + "postCreateCommand": "sudo .devcontainer/post-create.sh", + + // Environment variables to set globally inside the container. + "containerEnv": { + "BUILD_ENV": "devcontainer" + } // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. // "remoteUser": "root" diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh new file mode 100755 index 000000000000..3f9a0da567df --- /dev/null +++ b/.devcontainer/post-create.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +sed -i 's/Listen 80$//' /etc/apache2/ports.conf +sed -i 's//ServerName 127.0.0.1\n/' /etc/apache2/sites-enabled/000-default.conf diff --git a/.docker/Dockerfile b/.docker/Dockerfile index 40a9bc44af7c..090be992f5f9 100644 --- a/.docker/Dockerfile +++ b/.docker/Dockerfile @@ -9,11 +9,12 @@ ADD https://api.github.com/repos/php/phd/git/refs/heads/master version-phd.json ADD https://api.github.com/repos/php/doc-base/git/refs/heads/master version-doc-base.json RUN git clone --depth 1 https://github.com/php/phd.git && \ - git clone --depth 1 https://github.com/php/doc-base.git + git clone --depth 1 https://github.com/php/doc-base.git && \ + chown -R 1000:1000 /var/www RUN echo 'memory_limit = 512M' >> /usr/local/etc/php/conf.d/local.ini ENV FORMAT=xhtml -CMD php doc-base/configure.php --disable-segfault-error && \ - php phd/render.php --docbook doc-base/.manual.xml --output=/var/www/en/output --package PHP --format ${FORMAT} +CMD ["sh", "-c", "php doc-base/configure.php --disable-segfault-error && \ + php phd/render.php --docbook doc-base/.manual.xml --output=/var/www/en/output --package PHP --format ${FORMAT}"] diff --git a/Makefile b/Makefile index 06fb38cb2072..8d4c45bbfc58 100644 --- a/Makefile +++ b/Makefile @@ -20,10 +20,16 @@ endif xhtml: .docker/built docker run --rm ${PATHS} -w /var/www -u ${CURRENT_UID}:${CURRENT_GID} php/doc-en + if [ -n "${BUILD_ENV}" ] && [ "${BUILD_ENV}" = "devcontainer" ]; then \ + .devcontainer/configure-apache.sh "${PWD}/output/php-chunked-xhtml"; \ + fi php: .docker/built docker run --rm ${PATHS} -w /var/www -u ${CURRENT_UID}:${CURRENT_GID} \ -e FORMAT=php php/doc-en + if [ -n "${BUILD_ENV}" ] && [ "${BUILD_ENV}" = "devcontainer" ]; then \ + .devcontainer/configure-apache.sh "${PWD}/output/php-web"; \ + fi build: .docker/built From b20ddac62fba8dc63c007e5a2b33627d4b0a082a Mon Sep 17 00:00:00 2001 From: Jordi Kroon Date: Thu, 11 Jun 2026 21:39:10 +0200 Subject: [PATCH 03/23] Update Dependabot configuration --- .github/dependabot.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 42c955aa455f..168fc1f5f895 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,16 +1,10 @@ -# To get started with Dependabot version updates, you'll need to specify which -# package ecosystems to update and where the package manifests are located. -# Please see the documentation for more information: -# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates -# https://containers.dev/guide/dependabot - version: 2 updates: - package-ecosystem: "devcontainers" directory: "/" schedule: - interval: weekly + interval: "weekly" - package-ecosystem: "github-actions" directory: "/" schedule: - interval: monthly \ No newline at end of file + interval: "monthly" From c0479ab5043b45f965314c53cc6aab34796eaf5d Mon Sep 17 00:00:00 2001 From: Jordi Kroon Date: Sun, 14 Jun 2026 20:11:26 +0200 Subject: [PATCH 04/23] run devcontainer without docker --- .devcontainer/configure-apache.sh | 14 ------- .devcontainer/devcontainer.json | 61 +++++++++++++++---------------- .devcontainer/post-create.sh | 22 +++++++++++ 3 files changed, 51 insertions(+), 46 deletions(-) delete mode 100755 .devcontainer/configure-apache.sh diff --git a/.devcontainer/configure-apache.sh b/.devcontainer/configure-apache.sh deleted file mode 100755 index b6fc4d7c8644..000000000000 --- a/.devcontainer/configure-apache.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -if [ -z "$1" ] || [ ! -d "$1" ]; then - echo "Usage: $0 " - exit -fi - -sudo rm -rf /var/www/html -sudo chmod a+x "$1" -sudo ln -s "$1" /var/www/html && \ - echo "Apache web root directory set to $1" -if ! pgrep -x "apache2" > /dev/null; then - apache2ctl start -fi diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 8cfc860a93ce..3669b3c475b2 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,41 +1,38 @@ // For format details, see https://aka.ms/devcontainer.json. For config options, see the // README at: https://github.com/devcontainers/templates/tree/main/src/php { - "name": "PHP", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/php:1-8.4-bullseye", + "name": "PHP", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/php:1-8.4-bullseye", - // Features to add to the dev container. More info: https://containers.dev/features. - "features": { - "ghcr.io/devcontainers/features/docker-in-docker:2": {}, - "ghcr.io/devcontainers/features/git-lfs:1": {}, - "ghcr.io/devcontainers/features/github-cli:1": {} - }, + // Features to add to the dev container. More info: https://containers.dev/features. + "features": { + "ghcr.io/devcontainers/features/github-cli:1": {} + }, - // Configure tool-specific properties. - "customizations": { - // Configure properties specific to VS Code. - "vscode": { - "extensions": [ - "editorconfig.editorconfig", - "ms-vscode.makefile-tools" - ] - } - }, - - // Use 'forwardPorts' to make a list of ports inside the container available locally. - "forwardPorts": [ - 8080 - ], + // Configure tool-specific properties. + "customizations": { + // Configure properties specific to VS Code. + "vscode": { + "extensions": [ + "editorconfig.editorconfig", + "ms-vscode.makefile-tools" + ] + } + }, - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "sudo .devcontainer/post-create.sh", + // Use 'forwardPorts' to make a list of ports inside the container available locally. + "forwardPorts": [ + 8080 + ], - // Environment variables to set globally inside the container. - "containerEnv": { - "BUILD_ENV": "devcontainer" - } + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "sudo .devcontainer/post-create.sh", + "waitFor": "postCreateCommand", + "postAttachCommand": { + "Server": "sudo apache2ctl start" + } - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" } diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh index 3f9a0da567df..6af7441fdb02 100755 --- a/.devcontainer/post-create.sh +++ b/.devcontainer/post-create.sh @@ -1,4 +1,26 @@ #!/usr/bin/env bash +set -e + +# Apache: listen on 8080 so non-root tooling can interact. sed -i 's/Listen 80$//' /etc/apache2/ports.conf sed -i 's//ServerName 127.0.0.1\n/' /etc/apache2/sites-enabled/000-default.conf + +# Install dependencies +apt-get update +apt-get install -y --no-install-recommends default-jre-headless + +WORKSPACE="$(cd "$(dirname "$0")/.." && pwd)" +PARENT="$(dirname "$WORKSPACE")" +OWNER="$(stat -c '%U' "$WORKSPACE")" + +# Clone doc-base and phd as siblings of doc-en. +[ -d "$PARENT/doc-base" ] || sudo -u "$OWNER" git -C "$PARENT" clone --depth 1 https://github.com/php/doc-base.git +[ -d "$PARENT/phd" ] || sudo -u "$OWNER" git -C "$PARENT" clone --depth 1 https://github.com/php/phd.git + +# Serve the rendered output (not the XML sources) via Apache. +mkdir -p "$WORKSPACE/output/php-chunked-xhtml" +chown -R "$OWNER:$OWNER" "$WORKSPACE/output" +chmod a+x "$WORKSPACE" +rm -rf /var/www/html +ln -s "$WORKSPACE/output/php-chunked-xhtml" /var/www/html From c37f551f723649a2bbdec83e07f362a82a661475 Mon Sep 17 00:00:00 2001 From: Jordi Kroon Date: Sun, 14 Jun 2026 20:19:12 +0200 Subject: [PATCH 05/23] add Java LTS to devcontainer and remove redundant apt install --- .devcontainer/devcontainer.json | 7 ++++++- .devcontainer/post-create.sh | 4 ---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 3669b3c475b2..f9c29e770178 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -7,7 +7,12 @@ // Features to add to the dev container. More info: https://containers.dev/features. "features": { - "ghcr.io/devcontainers/features/github-cli:1": {} + "ghcr.io/devcontainers/features/github-cli:1": {}, + "ghcr.io/devcontainers/features/java:1": { + "version": "lts", + "installGradle": false, + "installMaven": false + } }, // Configure tool-specific properties. diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh index 6af7441fdb02..06c2c363821e 100755 --- a/.devcontainer/post-create.sh +++ b/.devcontainer/post-create.sh @@ -6,10 +6,6 @@ set -e sed -i 's/Listen 80$//' /etc/apache2/ports.conf sed -i 's//ServerName 127.0.0.1\n/' /etc/apache2/sites-enabled/000-default.conf -# Install dependencies -apt-get update -apt-get install -y --no-install-recommends default-jre-headless - WORKSPACE="$(cd "$(dirname "$0")/.." && pwd)" PARENT="$(dirname "$WORKSPACE")" OWNER="$(stat -c '%U' "$WORKSPACE")" From d655e5c3c48938d9acbaa4773bca5b4d1d9beab4 Mon Sep 17 00:00:00 2001 From: Jordi Kroon Date: Sun, 14 Jun 2026 20:32:14 +0200 Subject: [PATCH 06/23] streamline devcontainer setup and build process --- .devcontainer/build.sh | 17 +++++++++++++++++ .devcontainer/devcontainer.json | 3 +-- .devcontainer/post-create.sh | 9 +++++++++ Makefile | 6 ------ 4 files changed, 27 insertions(+), 8 deletions(-) create mode 100755 .devcontainer/build.sh diff --git a/.devcontainer/build.sh b/.devcontainer/build.sh new file mode 100755 index 000000000000..17d78f76c208 --- /dev/null +++ b/.devcontainer/build.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +set -e + +FORMAT="${1:-xhtml}" +LANG="${LANG:-en}" + +WORKSPACE="$(cd "$(dirname "$0")/.." && pwd)" +PARENT="$(dirname "$WORKSPACE")" + +cd "$WORKSPACE" +php "$PARENT/doc-base/configure.php" --with-lang="$LANG" +php "$PARENT/phd/render.php" \ + --docbook "$PARENT/doc-base/.manual.xml" \ + --output "$WORKSPACE/output" \ + --package PHP \ + --format "$FORMAT" diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index f9c29e770178..00ec58cafecb 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -20,8 +20,7 @@ // Configure properties specific to VS Code. "vscode": { "extensions": [ - "editorconfig.editorconfig", - "ms-vscode.makefile-tools" + "editorconfig.editorconfig" ] } }, diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh index 06c2c363821e..d3fc15141040 100755 --- a/.devcontainer/post-create.sh +++ b/.devcontainer/post-create.sh @@ -20,3 +20,12 @@ chown -R "$OWNER:$OWNER" "$WORKSPACE/output" chmod a+x "$WORKSPACE" rm -rf /var/www/html ln -s "$WORKSPACE/output/php-chunked-xhtml" /var/www/html + +cat <<'EOF' + + Devcontainer ready. + + Build the docs: .devcontainer/build.sh + View them: http://localhost:8080 (forwarded port 8080) + +EOF diff --git a/Makefile b/Makefile index e1230f690502..0b27d256b8a4 100644 --- a/Makefile +++ b/Makefile @@ -20,16 +20,10 @@ endif xhtml: .docker/built docker run --rm ${PATHS} -w /var/www -u ${CURRENT_UID}:${CURRENT_GID} php/doc-en - if [ -n "${BUILD_ENV}" ] && [ "${BUILD_ENV}" = "devcontainer" ]; then \ - .devcontainer/configure-apache.sh "${PWD}/output/php-chunked-xhtml"; \ - fi php: .docker/built docker run --rm ${PATHS} -w /var/www -u ${CURRENT_UID}:${CURRENT_GID} \ -e FORMAT=php php/doc-en - if [ -n "${BUILD_ENV}" ] && [ "${BUILD_ENV}" = "devcontainer" ]; then \ - .devcontainer/configure-apache.sh "${PWD}/output/php-web"; \ - fi build: .docker/built From b6be8576d445029f5784db44a3ef6d77bd25e155 Mon Sep 17 00:00:00 2001 From: Jordi Kroon Date: Sun, 14 Jun 2026 20:40:16 +0200 Subject: [PATCH 07/23] use docker (go back to start pretty much) --- .devcontainer/build.sh | 17 ----------------- .devcontainer/configure-apache.sh | 14 ++++++++++++++ .devcontainer/devcontainer.json | 19 +++++++++---------- .devcontainer/post-create.sh | 25 +++++-------------------- Makefile | 6 ++++++ 5 files changed, 34 insertions(+), 47 deletions(-) delete mode 100755 .devcontainer/build.sh create mode 100755 .devcontainer/configure-apache.sh diff --git a/.devcontainer/build.sh b/.devcontainer/build.sh deleted file mode 100755 index 17d78f76c208..000000000000 --- a/.devcontainer/build.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash - -set -e - -FORMAT="${1:-xhtml}" -LANG="${LANG:-en}" - -WORKSPACE="$(cd "$(dirname "$0")/.." && pwd)" -PARENT="$(dirname "$WORKSPACE")" - -cd "$WORKSPACE" -php "$PARENT/doc-base/configure.php" --with-lang="$LANG" -php "$PARENT/phd/render.php" \ - --docbook "$PARENT/doc-base/.manual.xml" \ - --output "$WORKSPACE/output" \ - --package PHP \ - --format "$FORMAT" diff --git a/.devcontainer/configure-apache.sh b/.devcontainer/configure-apache.sh new file mode 100755 index 000000000000..581c879cbf01 --- /dev/null +++ b/.devcontainer/configure-apache.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +if [ -z "$1" ] || [ ! -d "$1" ]; then + echo "Usage: $0 " + exit +fi + +sudo rm -rf /var/www/html +sudo chmod a+x "$1" +sudo ln -s "$1" /var/www/html && \ + echo "Apache web root directory set to $1" +if ! pgrep -x "apache2" > /dev/null; then + sudo apache2ctl start +fi diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 00ec58cafecb..322f6b0055b1 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -7,12 +7,9 @@ // Features to add to the dev container. More info: https://containers.dev/features. "features": { - "ghcr.io/devcontainers/features/github-cli:1": {}, - "ghcr.io/devcontainers/features/java:1": { - "version": "lts", - "installGradle": false, - "installMaven": false - } + "ghcr.io/devcontainers/features/docker-in-docker:2": {}, + "ghcr.io/devcontainers/features/git-lfs:1": {}, + "ghcr.io/devcontainers/features/github-cli:1": {} }, // Configure tool-specific properties. @@ -20,7 +17,8 @@ // Configure properties specific to VS Code. "vscode": { "extensions": [ - "editorconfig.editorconfig" + "editorconfig.editorconfig", + "ms-vscode.makefile-tools" ] } }, @@ -32,9 +30,10 @@ // Use 'postCreateCommand' to run commands after the container is created. "postCreateCommand": "sudo .devcontainer/post-create.sh", - "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "sudo apache2ctl start" + + // Environment variables to set globally inside the container. + "containerEnv": { + "BUILD_ENV": "devcontainer" } // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh index d3fc15141040..92cd3625f01f 100755 --- a/.devcontainer/post-create.sh +++ b/.devcontainer/post-create.sh @@ -1,31 +1,16 @@ #!/usr/bin/env bash -set -e - -# Apache: listen on 8080 so non-root tooling can interact. +# Apache: listen on 8080 so non-root tooling can interact. The web root is +# linked in by .devcontainer/configure-apache.sh after the first `make` build. sed -i 's/Listen 80$//' /etc/apache2/ports.conf sed -i 's//ServerName 127.0.0.1\n/' /etc/apache2/sites-enabled/000-default.conf -WORKSPACE="$(cd "$(dirname "$0")/.." && pwd)" -PARENT="$(dirname "$WORKSPACE")" -OWNER="$(stat -c '%U' "$WORKSPACE")" - -# Clone doc-base and phd as siblings of doc-en. -[ -d "$PARENT/doc-base" ] || sudo -u "$OWNER" git -C "$PARENT" clone --depth 1 https://github.com/php/doc-base.git -[ -d "$PARENT/phd" ] || sudo -u "$OWNER" git -C "$PARENT" clone --depth 1 https://github.com/php/phd.git - -# Serve the rendered output (not the XML sources) via Apache. -mkdir -p "$WORKSPACE/output/php-chunked-xhtml" -chown -R "$OWNER:$OWNER" "$WORKSPACE/output" -chmod a+x "$WORKSPACE" -rm -rf /var/www/html -ln -s "$WORKSPACE/output/php-chunked-xhtml" /var/www/html - cat <<'EOF' Devcontainer ready. - Build the docs: .devcontainer/build.sh - View them: http://localhost:8080 (forwarded port 8080) + Build the docs: make (chunked HTML, served at :8080) + make php (PHP web format) + View them: http://localhost:8080 EOF diff --git a/Makefile b/Makefile index 0b27d256b8a4..e1230f690502 100644 --- a/Makefile +++ b/Makefile @@ -20,10 +20,16 @@ endif xhtml: .docker/built docker run --rm ${PATHS} -w /var/www -u ${CURRENT_UID}:${CURRENT_GID} php/doc-en + if [ -n "${BUILD_ENV}" ] && [ "${BUILD_ENV}" = "devcontainer" ]; then \ + .devcontainer/configure-apache.sh "${PWD}/output/php-chunked-xhtml"; \ + fi php: .docker/built docker run --rm ${PATHS} -w /var/www -u ${CURRENT_UID}:${CURRENT_GID} \ -e FORMAT=php php/doc-en + if [ -n "${BUILD_ENV}" ] && [ "${BUILD_ENV}" = "devcontainer" ]; then \ + .devcontainer/configure-apache.sh "${PWD}/output/php-web"; \ + fi build: .docker/built From aa85cf07343c984f78cc21865a0acd8dd9eb601b Mon Sep 17 00:00:00 2001 From: Jordi Kroon Date: Sun, 14 Jun 2026 20:43:57 +0200 Subject: [PATCH 08/23] upgrade debian --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 322f6b0055b1..9be52b951edf 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -3,7 +3,7 @@ { "name": "PHP", // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/php:1-8.4-bullseye", + "image": "mcr.microsoft.com/devcontainers/php:1-8.4-bookworm", // Features to add to the dev container. More info: https://containers.dev/features. "features": { From 489485c8f572afe32864915fcfdca7c57fde2cc6 Mon Sep 17 00:00:00 2001 From: Jordi Kroon Date: Sun, 14 Jun 2026 21:01:59 +0200 Subject: [PATCH 09/23] replace Apache with PHP built-in server in devcontainer --- .devcontainer/devcontainer.json | 8 +++++++- .devcontainer/post-create.sh | 19 +++++++++++++++---- .../{configure-apache.sh => serve.sh} | 7 ++----- Makefile | 4 ++-- 4 files changed, 26 insertions(+), 12 deletions(-) rename .devcontainer/{configure-apache.sh => serve.sh} (61%) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 9be52b951edf..b15039cccd6a 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -3,7 +3,7 @@ { "name": "PHP", // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/php:1-8.4-bookworm", + "image": "mcr.microsoft.com/devcontainers/base:bookworm", // Features to add to the dev container. More info: https://containers.dev/features. "features": { @@ -31,6 +31,12 @@ // Use 'postCreateCommand' to run commands after the container is created. "postCreateCommand": "sudo .devcontainer/post-create.sh", + // Start php's built-in server each time the container is attached. Kills any + // leftover instance first so re-attaches don't fail to bind port 8080. + "postAttachCommand": { + "Server": "pkill -f 'php -S 0.0.0.0:8080' 2>/dev/null; exec php -S 0.0.0.0:8080 -t /var/www/html" + }, + // Environment variables to set globally inside the container. "containerEnv": { "BUILD_ENV": "devcontainer" diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh index 92cd3625f01f..d35d65a420ca 100755 --- a/.devcontainer/post-create.sh +++ b/.devcontainer/post-create.sh @@ -1,9 +1,20 @@ #!/usr/bin/env bash -# Apache: listen on 8080 so non-root tooling can interact. The web root is -# linked in by .devcontainer/configure-apache.sh after the first `make` build. -sed -i 's/Listen 80$//' /etc/apache2/ports.conf -sed -i 's//ServerName 127.0.0.1\n/' /etc/apache2/sites-enabled/000-default.conf +set -e + +. /etc/os-release +curl -fsSL https://packages.sury.org/php/apt.gpg | gpg --dearmor -o /usr/share/keyrings/sury-php.gpg +echo "deb [signed-by=/usr/share/keyrings/sury-php.gpg] https://packages.sury.org/php/ $VERSION_CODENAME main" \ + > /etc/apt/sources.list.d/sury-php.list +apt-get update +apt-get install -y --no-install-recommends php8.4-cli + +mkdir -p /var/www/html +cat >/var/www/html/index.html <<'HTML' + +PHP Docs devcontainer +

No build yet. Run make or make php.

+HTML cat <<'EOF' diff --git a/.devcontainer/configure-apache.sh b/.devcontainer/serve.sh similarity index 61% rename from .devcontainer/configure-apache.sh rename to .devcontainer/serve.sh index 581c879cbf01..55c12bafd0cb 100755 --- a/.devcontainer/configure-apache.sh +++ b/.devcontainer/serve.sh @@ -2,13 +2,10 @@ if [ -z "$1" ] || [ ! -d "$1" ]; then echo "Usage: $0 " - exit + exit 1 fi sudo rm -rf /var/www/html sudo chmod a+x "$1" sudo ln -s "$1" /var/www/html && \ - echo "Apache web root directory set to $1" -if ! pgrep -x "apache2" > /dev/null; then - sudo apache2ctl start -fi + echo "Now serving $1 at http://localhost:8080" diff --git a/Makefile b/Makefile index e1230f690502..da060119a182 100644 --- a/Makefile +++ b/Makefile @@ -21,14 +21,14 @@ endif xhtml: .docker/built docker run --rm ${PATHS} -w /var/www -u ${CURRENT_UID}:${CURRENT_GID} php/doc-en if [ -n "${BUILD_ENV}" ] && [ "${BUILD_ENV}" = "devcontainer" ]; then \ - .devcontainer/configure-apache.sh "${PWD}/output/php-chunked-xhtml"; \ + .devcontainer/serve.sh "${PWD}/output/php-chunked-xhtml"; \ fi php: .docker/built docker run --rm ${PATHS} -w /var/www -u ${CURRENT_UID}:${CURRENT_GID} \ -e FORMAT=php php/doc-en if [ -n "${BUILD_ENV}" ] && [ "${BUILD_ENV}" = "devcontainer" ]; then \ - .devcontainer/configure-apache.sh "${PWD}/output/php-web"; \ + .devcontainer/serve.sh "${PWD}/output/php-web"; \ fi build: .docker/built From 1472309451d22922469155b098b8b46872703605 Mon Sep 17 00:00:00 2001 From: Jordi Kroon Date: Sun, 14 Jun 2026 21:05:07 +0200 Subject: [PATCH 10/23] Drop LFS --- .devcontainer/devcontainer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index b15039cccd6a..9563953e9e38 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -8,7 +8,6 @@ // Features to add to the dev container. More info: https://containers.dev/features. "features": { "ghcr.io/devcontainers/features/docker-in-docker:2": {}, - "ghcr.io/devcontainers/features/git-lfs:1": {}, "ghcr.io/devcontainers/features/github-cli:1": {} }, From a798e03f7bed0c41cba232f43136958dfacfa0d3 Mon Sep 17 00:00:00 2001 From: Jordi Kroon Date: Sun, 14 Jun 2026 21:14:29 +0200 Subject: [PATCH 11/23] move php server startup to VS Code debug config --- .devcontainer/devcontainer.json | 21 ++++++++++++++------- .devcontainer/post-create.sh | 1 + 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 9563953e9e38..a50a3c68088c 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -18,7 +18,20 @@ "extensions": [ "editorconfig.editorconfig", "ms-vscode.makefile-tools" - ] + ], + "settings": { + "launch": { + "version": "0.2.0", + "configurations": [ + { + "name": "Serve docs (php -S :8080)", + "type": "node-terminal", + "request": "launch", + "command": "pkill -f 'php -S 0.0.0.0:8080' 2>/dev/null; php -S 0.0.0.0:8080 -t /var/www/html" + } + ] + } + } } }, @@ -30,12 +43,6 @@ // Use 'postCreateCommand' to run commands after the container is created. "postCreateCommand": "sudo .devcontainer/post-create.sh", - // Start php's built-in server each time the container is attached. Kills any - // leftover instance first so re-attaches don't fail to bind port 8080. - "postAttachCommand": { - "Server": "pkill -f 'php -S 0.0.0.0:8080' 2>/dev/null; exec php -S 0.0.0.0:8080 -t /var/www/html" - }, - // Environment variables to set globally inside the container. "containerEnv": { "BUILD_ENV": "devcontainer" diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh index d35d65a420ca..ecc97fed7130 100755 --- a/.devcontainer/post-create.sh +++ b/.devcontainer/post-create.sh @@ -22,6 +22,7 @@ cat <<'EOF' Build the docs: make (chunked HTML, served at :8080) make php (PHP web format) + Serve them: F5 > "Serve docs" (Run and Debug panel) View them: http://localhost:8080 EOF From aee62f7046ddbfbefc4b14c0582a835ced4bd826 Mon Sep 17 00:00:00 2001 From: Jordi Kroon Date: Sun, 14 Jun 2026 21:30:56 +0200 Subject: [PATCH 12/23] improve devcontainer launch configurations and serve script --- .devcontainer/devcontainer.json | 10 ++++++++-- .devcontainer/post-create.sh | 6 +++--- .devcontainer/serve.sh | 25 ++++++++++++++++++------- 3 files changed, 29 insertions(+), 12 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index a50a3c68088c..538e3ddeff82 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -24,10 +24,16 @@ "version": "0.2.0", "configurations": [ { - "name": "Serve docs (php -S :8080)", + "name": "Build XHTML & serve", "type": "node-terminal", "request": "launch", - "command": "pkill -f 'php -S 0.0.0.0:8080' 2>/dev/null; php -S 0.0.0.0:8080 -t /var/www/html" + "command": "make" + }, + { + "name": "Build PHP web & serve", + "type": "node-terminal", + "request": "launch", + "command": "make php" } ] } diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh index ecc97fed7130..0a3d3cfbb570 100755 --- a/.devcontainer/post-create.sh +++ b/.devcontainer/post-create.sh @@ -20,9 +20,9 @@ cat <<'EOF' Devcontainer ready. - Build the docs: make (chunked HTML, served at :8080) - make php (PHP web format) - Serve them: F5 > "Serve docs" (Run and Debug panel) + Build & serve: F5 ("Build XHTML & serve" in Run and Debug) + "Build PHP web & serve" for php format + "Serve only (no build)" to skip rebuild View them: http://localhost:8080 EOF diff --git a/.devcontainer/serve.sh b/.devcontainer/serve.sh index 55c12bafd0cb..2f19717d4c91 100755 --- a/.devcontainer/serve.sh +++ b/.devcontainer/serve.sh @@ -1,11 +1,22 @@ #!/usr/bin/env bash -if [ -z "$1" ] || [ ! -d "$1" ]; then - echo "Usage: $0 " - exit 1 +set -e + +if [ -n "$1" ]; then + if [ ! -d "$1" ]; then + echo "Usage: $0 []" + exit 1 + fi + sudo rm -rf /var/www/html + sudo chmod a+x "$1" + sudo ln -s "$1" /var/www/html + echo "Web root set to $1" +fi + +if pgrep -f 'php -S 0.0.0.0:8080' >/dev/null; then + echo "Server already running at http://localhost:8080" + exit 0 fi -sudo rm -rf /var/www/html -sudo chmod a+x "$1" -sudo ln -s "$1" /var/www/html && \ - echo "Now serving $1 at http://localhost:8080" +echo "Starting server at http://localhost:8080" +exec php -S 0.0.0.0:8080 -t /var/www/html From 6de0d69fbcd70467e48faee7fc7c676ae30efcbe Mon Sep 17 00:00:00 2001 From: Jordi Kroon Date: Sun, 14 Jun 2026 21:46:56 +0200 Subject: [PATCH 13/23] don't use docker-in-docker --- .devcontainer/build.sh | 21 +++++++++++++++++++++ .devcontainer/devcontainer.json | 26 ++++++++++++-------------- .devcontainer/post-create.sh | 28 ++++++++++++---------------- .devcontainer/serve.sh | 22 ---------------------- Makefile | 6 ------ 5 files changed, 45 insertions(+), 58 deletions(-) create mode 100755 .devcontainer/build.sh delete mode 100755 .devcontainer/serve.sh diff --git a/.devcontainer/build.sh b/.devcontainer/build.sh new file mode 100755 index 000000000000..afae7c1997d4 --- /dev/null +++ b/.devcontainer/build.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -e + +FORMAT="${1:-xhtml}" + +case "$FORMAT" in + xhtml) OUTDIR="output/php-chunked-xhtml" ;; + php) OUTDIR="output/php-web" ;; + *) echo "Usage: $0 [xhtml|php]" >&2; exit 1 ;; +esac + +php ../doc-base/configure.php --with-lang=en +php ../phd/render.php \ + --docbook ../doc-base/.manual.xml \ + --output ./output \ + --package PHP \ + --format "$FORMAT" + +pkill -f 'php -S 0.0.0.0:8080' 2>/dev/null || true +exec php -S 0.0.0.0:8080 -t "$OUTDIR" diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 538e3ddeff82..b819c62dc89e 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,13 +2,16 @@ // README at: https://github.com/devcontainers/templates/tree/main/src/php { "name": "PHP", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/base:bookworm", + "image": "mcr.microsoft.com/devcontainers/php:8.4-trixie", // Features to add to the dev container. More info: https://containers.dev/features. "features": { - "ghcr.io/devcontainers/features/docker-in-docker:2": {}, - "ghcr.io/devcontainers/features/github-cli:1": {} + "ghcr.io/devcontainers/features/github-cli:1": {}, + "ghcr.io/devcontainers/features/java:1": { + "version": "lts", + "installGradle": false, + "installMaven": false + } }, // Configure tool-specific properties. @@ -16,9 +19,9 @@ // Configure properties specific to VS Code. "vscode": { "extensions": [ - "editorconfig.editorconfig", - "ms-vscode.makefile-tools" + "editorconfig.editorconfig" ], + // Workspace-level launch config "settings": { "launch": { "version": "0.2.0", @@ -27,13 +30,13 @@ "name": "Build XHTML & serve", "type": "node-terminal", "request": "launch", - "command": "make" + "command": ".devcontainer/build.sh xhtml" }, { "name": "Build PHP web & serve", "type": "node-terminal", "request": "launch", - "command": "make php" + "command": ".devcontainer/build.sh php" } ] } @@ -47,12 +50,7 @@ ], // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "sudo .devcontainer/post-create.sh", - - // Environment variables to set globally inside the container. - "containerEnv": { - "BUILD_ENV": "devcontainer" - } + "postCreateCommand": "sudo .devcontainer/post-create.sh" // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. // "remoteUser": "root" diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh index 0a3d3cfbb570..a3f4d02bbfed 100755 --- a/.devcontainer/post-create.sh +++ b/.devcontainer/post-create.sh @@ -2,27 +2,23 @@ set -e -. /etc/os-release -curl -fsSL https://packages.sury.org/php/apt.gpg | gpg --dearmor -o /usr/share/keyrings/sury-php.gpg -echo "deb [signed-by=/usr/share/keyrings/sury-php.gpg] https://packages.sury.org/php/ $VERSION_CODENAME main" \ - > /etc/apt/sources.list.d/sury-php.list -apt-get update -apt-get install -y --no-install-recommends php8.4-cli - -mkdir -p /var/www/html -cat >/var/www/html/index.html <<'HTML' - -PHP Docs devcontainer -

No build yet. Run make or make php.

-HTML +WORKSPACE="$(cd "$(dirname "$0")/.." && pwd)" +PARENT="$(dirname "$WORKSPACE")" +OWNER="$(stat -c '%U' "$WORKSPACE")" + +# Clone doc-base and phd as siblings of doc-en +[ -d "$PARENT/doc-base" ] || sudo -u "$OWNER" git -C "$PARENT" clone --depth 1 https://github.com/php/doc-base.git +[ -d "$PARENT/phd" ] || sudo -u "$OWNER" git -C "$PARENT" clone --depth 1 https://github.com/php/phd.git + +# Pre-create the served directory +sudo -u "$OWNER" mkdir -p "$WORKSPACE/output/php-chunked-xhtml" cat <<'EOF' Devcontainer ready. - Build & serve: F5 ("Build XHTML & serve" in Run and Debug) - "Build PHP web & serve" for php format - "Serve only (no build)" to skip rebuild + Build & serve: F5 > "Build XHTML & serve" (or "Build PHP web & serve") + View them: http://localhost:8080 EOF diff --git a/.devcontainer/serve.sh b/.devcontainer/serve.sh deleted file mode 100755 index 2f19717d4c91..000000000000 --- a/.devcontainer/serve.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash - -set -e - -if [ -n "$1" ]; then - if [ ! -d "$1" ]; then - echo "Usage: $0 []" - exit 1 - fi - sudo rm -rf /var/www/html - sudo chmod a+x "$1" - sudo ln -s "$1" /var/www/html - echo "Web root set to $1" -fi - -if pgrep -f 'php -S 0.0.0.0:8080' >/dev/null; then - echo "Server already running at http://localhost:8080" - exit 0 -fi - -echo "Starting server at http://localhost:8080" -exec php -S 0.0.0.0:8080 -t /var/www/html diff --git a/Makefile b/Makefile index da060119a182..0b27d256b8a4 100644 --- a/Makefile +++ b/Makefile @@ -20,16 +20,10 @@ endif xhtml: .docker/built docker run --rm ${PATHS} -w /var/www -u ${CURRENT_UID}:${CURRENT_GID} php/doc-en - if [ -n "${BUILD_ENV}" ] && [ "${BUILD_ENV}" = "devcontainer" ]; then \ - .devcontainer/serve.sh "${PWD}/output/php-chunked-xhtml"; \ - fi php: .docker/built docker run --rm ${PATHS} -w /var/www -u ${CURRENT_UID}:${CURRENT_GID} \ -e FORMAT=php php/doc-en - if [ -n "${BUILD_ENV}" ] && [ "${BUILD_ENV}" = "devcontainer" ]; then \ - .devcontainer/serve.sh "${PWD}/output/php-web"; \ - fi build: .docker/built From de4584ae95b3fb5a42aba9a76d01761550300114 Mon Sep 17 00:00:00 2001 From: Jordi Kroon Date: Sun, 14 Jun 2026 21:55:51 +0200 Subject: [PATCH 14/23] enhance devcontainer configuration --- .devcontainer/devcontainer.json | 10 ++++++++-- .devcontainer/post-create.sh | 3 +++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index b819c62dc89e..21cc9bc67684 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -19,7 +19,8 @@ // Configure properties specific to VS Code. "vscode": { "extensions": [ - "editorconfig.editorconfig" + "editorconfig.editorconfig", + "redhat.vscode-xml" ], // Workspace-level launch config "settings": { @@ -50,7 +51,12 @@ ], // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "sudo .devcontainer/post-create.sh" + "postCreateCommand": "sudo .devcontainer/post-create.sh", + + // Silence Xdebug's "Could not connect to debugging client" notice + "containerEnv": { + "XDEBUG_MODE": "off" + } // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. // "remoteUser": "root" diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh index a3f4d02bbfed..e57a591e5738 100755 --- a/.devcontainer/post-create.sh +++ b/.devcontainer/post-create.sh @@ -10,6 +10,9 @@ OWNER="$(stat -c '%U' "$WORKSPACE")" [ -d "$PARENT/doc-base" ] || sudo -u "$OWNER" git -C "$PARENT" clone --depth 1 https://github.com/php/doc-base.git [ -d "$PARENT/phd" ] || sudo -u "$OWNER" git -C "$PARENT" clone --depth 1 https://github.com/php/phd.git +# doc-base's configure.php looks for the language source as a sibling directory +[ -e "$PARENT/en" ] || sudo -u "$OWNER" ln -s "$WORKSPACE" "$PARENT/en" + # Pre-create the served directory sudo -u "$OWNER" mkdir -p "$WORKSPACE/output/php-chunked-xhtml" From 524b34638b6d864f2cf330282a1ae969314e46e9 Mon Sep 17 00:00:00 2001 From: Jordi Kroon Date: Sun, 14 Jun 2026 22:27:31 +0200 Subject: [PATCH 15/23] improve devcontainer build configuration --- .devcontainer/build.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.devcontainer/build.sh b/.devcontainer/build.sh index afae7c1997d4..3e9bdd681822 100755 --- a/.devcontainer/build.sh +++ b/.devcontainer/build.sh @@ -10,7 +10,12 @@ case "$FORMAT" in *) echo "Usage: $0 [xhtml|php]" >&2; exit 1 ;; esac -php ../doc-base/configure.php --with-lang=en +php ../doc-base/configure.php \ + --disable-libxml-check \ + --enable-xml-details \ + --redirect-stderr-to-stdout \ + --with-lang=en + php ../phd/render.php \ --docbook ../doc-base/.manual.xml \ --output ./output \ From ceeddbd533327dd398958b43ee86ac9d2b56d462 Mon Sep 17 00:00:00 2001 From: Jordi Kroon Date: Sun, 14 Jun 2026 22:48:12 +0200 Subject: [PATCH 16/23] increase JVM entity size limits for doc-base builds --- .devcontainer/build.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.devcontainer/build.sh b/.devcontainer/build.sh index 3e9bdd681822..a1413039f8e8 100755 --- a/.devcontainer/build.sh +++ b/.devcontainer/build.sh @@ -10,6 +10,11 @@ case "$FORMAT" in *) echo "Usage: $0 [xhtml|php]" >&2; exit 1 ;; esac + # doc-base invokes `java -jar jing.jar` with no flags, so the only handle on + # the JAXP entity-size limit is the JVM env vars. The PHP manual is well past + # the 100k default and we have no other way to lift the limit. + export _JAVA_OPTIONS='-Djdk.xml.totalEntitySizeLimit=0 -Djdk.xml.entityExpansionLimit=0 -Djdk.xml.maxGeneralEntitySizeLimit=0' + php ../doc-base/configure.php \ --disable-libxml-check \ --enable-xml-details \ From 2b757c192020efd3e7c20ed3739a5ce0b661cfeb Mon Sep 17 00:00:00 2001 From: Jordi Kroon Date: Sun, 14 Jun 2026 22:59:29 +0200 Subject: [PATCH 17/23] increase php memory limit and disable xdebug in devcontainer --- .devcontainer/build.sh | 2 +- .devcontainer/post-create.sh | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.devcontainer/build.sh b/.devcontainer/build.sh index a1413039f8e8..456a66ab6815 100755 --- a/.devcontainer/build.sh +++ b/.devcontainer/build.sh @@ -21,7 +21,7 @@ php ../doc-base/configure.php \ --redirect-stderr-to-stdout \ --with-lang=en -php ../phd/render.php \ +php -d memory_limit=512M ../phd/render.php \ --docbook ../doc-base/.manual.xml \ --output ./output \ --package PHP \ diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh index e57a591e5738..61713f90443b 100755 --- a/.devcontainer/post-create.sh +++ b/.devcontainer/post-create.sh @@ -13,6 +13,9 @@ OWNER="$(stat -c '%U' "$WORKSPACE")" # doc-base's configure.php looks for the language source as a sibling directory [ -e "$PARENT/en" ] || sudo -u "$OWNER" ln -s "$WORKSPACE" "$PARENT/en" +# Xdebug degrades performance and is not needed for the build, so disable it by default. +rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini + # Pre-create the served directory sudo -u "$OWNER" mkdir -p "$WORKSPACE/output/php-chunked-xhtml" From 60a501d66a71ddbabae11ef4b0f08fcffcc5e5f5 Mon Sep 17 00:00:00 2001 From: Jordi Kroon Date: Mon, 15 Jun 2026 00:00:10 +0200 Subject: [PATCH 18/23] correct path for removing xdebug --- .devcontainer/post-create.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh index 61713f90443b..2ea8a6764a2f 100755 --- a/.devcontainer/post-create.sh +++ b/.devcontainer/post-create.sh @@ -14,7 +14,7 @@ OWNER="$(stat -c '%U' "$WORKSPACE")" [ -e "$PARENT/en" ] || sudo -u "$OWNER" ln -s "$WORKSPACE" "$PARENT/en" # Xdebug degrades performance and is not needed for the build, so disable it by default. -rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini +rm -f /usr/local/etc/php/conf.d/xdebug.ini # Pre-create the served directory sudo -u "$OWNER" mkdir -p "$WORKSPACE/output/php-chunked-xhtml" From 1fd4680282c6ad410db18b33d29791ede7102153 Mon Sep 17 00:00:00 2001 From: Jordi Kroon Date: Mon, 15 Jun 2026 00:24:57 +0200 Subject: [PATCH 19/23] configure devcontainer memory requirements --- .devcontainer/devcontainer.json | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 21cc9bc67684..dc1f994d4bdc 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -14,6 +14,13 @@ } }, + // Increase the default 4GB of memory for the container to allow for building the docs, + // otherwwise bullding is really slow. + "hostRequirements": { + "cpus": 4, + "memory": "16gb" + }, + // Configure tool-specific properties. "customizations": { // Configure properties specific to VS Code. @@ -53,11 +60,6 @@ // Use 'postCreateCommand' to run commands after the container is created. "postCreateCommand": "sudo .devcontainer/post-create.sh", - // Silence Xdebug's "Could not connect to debugging client" notice - "containerEnv": { - "XDEBUG_MODE": "off" - } - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. // "remoteUser": "root" } From 417f9d1fb7235317b3c969edb762bcdadf4fbee9 Mon Sep 17 00:00:00 2001 From: Jordi Kroon Date: Mon, 15 Jun 2026 18:48:35 +0200 Subject: [PATCH 20/23] chore: remove devcontainer memory requirements Remove the hostRequirements configuration that specified 4 CPUs and 16GB of memory. This allows the devcontainer to use default resource allocations instead of requiring elevated system resources. --- .devcontainer/devcontainer.json | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index dc1f994d4bdc..22afed7eed61 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -14,13 +14,6 @@ } }, - // Increase the default 4GB of memory for the container to allow for building the docs, - // otherwwise bullding is really slow. - "hostRequirements": { - "cpus": 4, - "memory": "16gb" - }, - // Configure tool-specific properties. "customizations": { // Configure properties specific to VS Code. From 0b1aa64fedb56d6a9ff251223535f5e6917ee0b4 Mon Sep 17 00:00:00 2001 From: Jordi Kroon Date: Mon, 15 Jun 2026 18:49:57 +0200 Subject: [PATCH 21/23] chore: remove symbolic link setup from devcontainer post-create script The symbolic link creation for doc-base's language source directory is no longer needed and has been removed from the post-create initialization script. --- .devcontainer/post-create.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh index 2ea8a6764a2f..f1be73db5d52 100755 --- a/.devcontainer/post-create.sh +++ b/.devcontainer/post-create.sh @@ -10,9 +10,6 @@ OWNER="$(stat -c '%U' "$WORKSPACE")" [ -d "$PARENT/doc-base" ] || sudo -u "$OWNER" git -C "$PARENT" clone --depth 1 https://github.com/php/doc-base.git [ -d "$PARENT/phd" ] || sudo -u "$OWNER" git -C "$PARENT" clone --depth 1 https://github.com/php/phd.git -# doc-base's configure.php looks for the language source as a sibling directory -[ -e "$PARENT/en" ] || sudo -u "$OWNER" ln -s "$WORKSPACE" "$PARENT/en" - # Xdebug degrades performance and is not needed for the build, so disable it by default. rm -f /usr/local/etc/php/conf.d/xdebug.ini From 330addad10eb9b3d697c5839077ceffb40c890c1 Mon Sep 17 00:00:00 2001 From: Jordi Kroon Date: Mon, 15 Jun 2026 18:59:07 +0200 Subject: [PATCH 22/23] Revert "chore: remove symbolic link setup from devcontainer post-create script" This reverts commit 0b1aa64fedb56d6a9ff251223535f5e6917ee0b4. --- .devcontainer/post-create.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh index f1be73db5d52..2ea8a6764a2f 100755 --- a/.devcontainer/post-create.sh +++ b/.devcontainer/post-create.sh @@ -10,6 +10,9 @@ OWNER="$(stat -c '%U' "$WORKSPACE")" [ -d "$PARENT/doc-base" ] || sudo -u "$OWNER" git -C "$PARENT" clone --depth 1 https://github.com/php/doc-base.git [ -d "$PARENT/phd" ] || sudo -u "$OWNER" git -C "$PARENT" clone --depth 1 https://github.com/php/phd.git +# doc-base's configure.php looks for the language source as a sibling directory +[ -e "$PARENT/en" ] || sudo -u "$OWNER" ln -s "$WORKSPACE" "$PARENT/en" + # Xdebug degrades performance and is not needed for the build, so disable it by default. rm -f /usr/local/etc/php/conf.d/xdebug.ini From 88fdcd6d1c545c875bed939e65a0a69d248e1b5e Mon Sep 17 00:00:00 2001 From: Jordi Kroon Date: Mon, 15 Jun 2026 21:35:57 +0200 Subject: [PATCH 23/23] fix dependabot.yml indentation --- .github/dependabot.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 168fc1f5f895..3237fd11ac9b 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,9 +1,9 @@ version: 2 updates: - - package-ecosystem: "devcontainers" - directory: "/" - schedule: - interval: "weekly" + - package-ecosystem: "devcontainers" + directory: "/" + schedule: + interval: "weekly" - package-ecosystem: "github-actions" directory: "/" schedule: