diff --git a/.github/workflows/features-global.yml b/.github/workflows/features-global.yml index ecebd707..bee4cf19 100644 --- a/.github/workflows/features-global.yml +++ b/.github/workflows/features-global.yml @@ -25,9 +25,11 @@ jobs: - php81-alpine-base - php82-alpine-base - php83-alpine-base + - php84-alpine-base - php81-ubuntu-base - php82-ubuntu-base - php83-ubuntu-base + - php84-ubuntu-base steps: - name: Checkout repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 diff --git a/.github/workflows/features-scenarios.yml b/.github/workflows/features-scenarios.yml index adf30309..08c41f64 100644 --- a/.github/workflows/features-scenarios.yml +++ b/.github/workflows/features-scenarios.yml @@ -48,6 +48,8 @@ jobs: filter: '82' - feature: php filter: '83' + - feature: php + filter: '84' - feature: phpmyadmin - feature: playwright - feature: ssh diff --git a/features/src/php/devcontainer-feature.json b/features/src/php/devcontainer-feature.json index ab7d4931..e732dcad 100644 --- a/features/src/php/devcontainer-feature.json +++ b/features/src/php/devcontainer-feature.json @@ -2,12 +2,12 @@ "id": "php", "name": "PHP", "description": "Installs PHP into the Dev Environment", - "version": "2.6.0", + "version": "2.7.0", "documentationURL": "https://github.com/Automattic/vip-codespaces/tree/trunk/features/src/php", "options": { "version": { "type": "string", - "enum": ["8.0", "8.1", "8.2", "8.3"], + "enum": ["8.0", "8.1", "8.2", "8.3", "8.4"], "default": "8.2", "description": "PHP version" }, diff --git a/features/src/php/install.sh b/features/src/php/install.sh index 5b89673c..f5f3b54b 100755 --- a/features/src/php/install.sh +++ b/features/src/php/install.sh @@ -157,6 +157,7 @@ setup_php83_alpine() { EXTENSIONS= fi + # shellcheck disable=SC2086 apk add --no-cache \ icu-data-full ghostscript \ php83 php83-fpm php83-pear \ @@ -196,7 +197,7 @@ setup_php83_alpine() { php83-xml \ php83-xmlreader \ php83-xmlwriter \ - php83-zip + php83-zip ${EXTENSIONS} if [ "${SKIP_GMAGICK}" != 'true' ]; then apk add --no-cache php83-dev gcc make libc-dev graphicsmagick-dev libtool graphicsmagick libgomp @@ -219,6 +220,77 @@ setup_php83_alpine() { true } +setup_php84_alpine() { + if [ "${LITE_INSTALL}" != 'true' ]; then + # missing: php84-pecl-mcrypt php84-pecl-timezonedb + EXTENSIONS="icu-data-full ghostscript php84-bcmath php84-ftp php84-intl php84-soap php84-pecl-igbinary php84-pecl-ssh2" + else + EXTENSIONS= + fi + + # shellcheck disable=SC2086 + apk add --no-cache \ + icu-data-full ghostscript \ + php84 php84-fpm php84-pear \ + php84-pecl-apcu \ + php84-calendar \ + php84-ctype \ + php84-curl \ + php84-dom \ + php84-exif \ + php84-fileinfo \ + php84-ftp \ + php84-gd \ + php84-gmp \ + php84-iconv \ + php84-mbstring \ + php84-pecl-memcache \ + php84-pecl-memcached \ + php84-mysqli \ + php84-mysqlnd \ + php84-opcache \ + php84-openssl \ + php84-pcntl \ + php84-pdo \ + php84-pdo_mysql \ + php84-pdo_sqlite \ + php84-phar \ + php84-posix \ + php84-session \ + php84-shmop \ + php84-simplexml \ + php84-sockets \ + php84-sodium \ + php84-sqlite3 \ + php84-sysvsem \ + php84-sysvshm \ + php84-tokenizer \ + php84-xml \ + php84-xmlreader \ + php84-xmlwriter \ + php84-zip ${EXTENSIONS} -X https://dl-cdn.alpinelinux.org/alpine/edge/testing + + if [ "${SKIP_GMAGICK}" != 'true' ]; then + apk add --no-cache php84-dev gcc make libc-dev graphicsmagick-dev libtool graphicsmagick libgomp -X https://dl-cdn.alpinelinux.org/alpine/edge/testing + pecl84 channel-update pecl.php.net + pecl84 install channel://pecl.php.net/gmagick-2.0.6RC1 < /dev/null || true + echo "extension=gmagick.so" > /etc/php84/conf.d/40_gmagick.ini + apk del --no-cache php84-dev gcc make libc-dev graphicsmagick-dev libtool + fi + + # Alpine Edge: this symlink is broken + rm -f /usr/bin/phar.phar + + [ ! -f /usr/bin/pear ] && ln -s /usr/bin/pear84 /usr/bin/pear + [ ! -f /usr/bin/peardev ] && ln -s /usr/bin/peardev84 /usr/bin/peardev + [ ! -f /usr/bin/pecl ] && ln -s /usr/bin/pecl84 /usr/bin/pecl + [ ! -f /usr/bin/phar.phar ] && ln -s /usr/bin/phar.phar84 /usr/bin/phar.phar + [ ! -f /usr/bin/phar ] && ln -s /usr/bin/phar84 /usr/bin/phar + [ ! -f /usr/bin/php ] && ln -s /usr/bin/php84 /usr/bin/php + [ ! -f /usr/sbin/php-fpm ] && ln -s /usr/sbin/php-fpm84 /usr/sbin/php-fpm + true +} + setup_php81_deb() { if [ "${LITE_INSTALL}" != 'true' ]; then EXTENSIONS="ghostscript php8.1-bcmath php8.1-igbinary php8.1-intl php8.1-mcrypt php8.1-soap php8.1-ssh2" @@ -342,6 +414,47 @@ setup_php83_deb() { update-rc.d -f php8.3-fpm remove } +setup_php84_deb() { + if [ "${LITE_INSTALL}" != 'true' ]; then + EXTENSIONS="ghostscript php8.4-bcmath php8.4-igbinary php8.4-intl php8.4-mcrypt php8.4-soap php8.4-ssh2" + else + EXTENSIONS= + fi + + if [ "${SKIP_GMAGICK}" != 'true' ]; then + EXTENSIONS="${EXTENSIONS} php8.4-gmagick" + fi + + # shellcheck disable=SC2086 + eatmydata apt-get install -y --no-install-recommends \ + php8.4-cli php8.4-fpm \ + php8.4-apcu php8.4-curl php8.4-gd php8.4-gmp php8.4-mbstring \ + php8.4-memcache php8.4-memcached php8.4-mysql php8.4-sqlite3 php8.4-xml php8.4-zip ${EXTENSIONS} + eatmydata apt-get install -y --no-install-recommends php-pear + phpdismod ffi gettext readline sysvmsg xsl + + ln -s /usr/sbin/php-fpm8.4 /usr/sbin/php-fpm + + if [ "${LITE_INSTALL}" != 'true' ]; then + PACKAGES="php8.4-dev" + if ! hash make >/dev/null 2>&1; then + PACKAGES="${PACKAGES} make" + fi + + # shellcheck disable=SC2086 + eatmydata apt-get install -y --no-install-recommends ${PACKAGES} + pecl channel-update pecl.php.net + pecl install timezonedb < /dev/null + echo "extension=timezonedb.so" > /etc/php/8.4/mods-available/timezonedb.ini + phpenmod timezonedb + + # shellcheck disable=SC2086 + eatmydata apt-get remove --purge -y ${PACKAGES} + fi + + update-rc.d -f php8.4-fpm remove +} + echo "(*) Installing PHP ${PHP_VERSION}..." # shellcheck source=/dev/null @@ -423,6 +536,11 @@ case "${ID_LIKE}" in setup_php83_deb ;; + "8.4") + PHP_INI_DIR=/etc/php/8.4 + setup_php84_deb + ;; + *) echo "(!) PHP version ${PHP_VERSION} is not supported." exit 1 @@ -474,6 +592,11 @@ case "${ID_LIKE}" in setup_php83_alpine ;; + "8.4") + PHP_INI_DIR=/etc/php84 + setup_php84_alpine + ;; + *) echo "(!) PHP version ${PHP_VERSION} is not supported." exit 1 diff --git a/features/src/xdebug/devcontainer-feature.json b/features/src/xdebug/devcontainer-feature.json index 27fd135a..e91e76fa 100644 --- a/features/src/xdebug/devcontainer-feature.json +++ b/features/src/xdebug/devcontainer-feature.json @@ -1,7 +1,7 @@ { "name": "Xdebug", "id": "xdebug", - "version": "1.4.1", + "version": "1.5.0", "description": "Configures Xdebug for the Dev Environment", "options": { "enabled": { diff --git a/features/src/xdebug/install.sh b/features/src/xdebug/install.sh index f89b68d1..eddbf0e8 100755 --- a/features/src/xdebug/install.sh +++ b/features/src/xdebug/install.sh @@ -35,6 +35,11 @@ xdebug_83_alpine() { rm -f /etc/php81/conf.d/50_xdebug.ini } +xdebug_84_alpine() { + apk add --no-cache php84-pecl-xdebug -X https://dl-cdn.alpinelinux.org/alpine/edge/testing + rm -f /etc/php81/conf.d/50_xdebug.ini +} + xdebug_81_deb() { apt-get install -y --no-install-recommends php8.1-xdebug } @@ -47,6 +52,10 @@ xdebug_83_deb() { apt-get install -y --no-install-recommends php8.3-xdebug } +xdebug_84_deb() { + apt-get install -y --no-install-recommends php8.4-xdebug +} + if [ "$(id -u || true)" -ne 0 ]; then echo 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.' exit 1 @@ -86,6 +95,9 @@ case "${ID_LIKE}" in 8.3) xdebug_83_deb ;; + 8.4) + xdebug_84_deb + ;; *) echo "(!) Unsupported PHP version: ${PHP_VERSION}" exit 1 @@ -109,6 +121,9 @@ case "${ID_LIKE}" in 8.3) xdebug_83_alpine ;; + 8.4) + xdebug_84_alpine + ;; *) echo "(!) Unsupported PHP version: ${PHP_VERSION}" exit 1 diff --git a/features/test/_global/php84-alpine-base.sh b/features/test/_global/php84-alpine-base.sh new file mode 120000 index 00000000..2564aa1b --- /dev/null +++ b/features/test/_global/php84-alpine-base.sh @@ -0,0 +1 @@ +php81-alpine-base.sh \ No newline at end of file diff --git a/features/test/_global/php84-ubuntu-base.sh b/features/test/_global/php84-ubuntu-base.sh new file mode 120000 index 00000000..2564aa1b --- /dev/null +++ b/features/test/_global/php84-ubuntu-base.sh @@ -0,0 +1 @@ +php81-alpine-base.sh \ No newline at end of file diff --git a/features/test/_global/scenarios.json b/features/test/_global/scenarios.json index c8c7a7bb..5d40e008 100644 --- a/features/test/_global/scenarios.json +++ b/features/test/_global/scenarios.json @@ -257,6 +257,92 @@ "./dev-tools" ] }, + "php84-alpine-base": { + "image": "ghcr.io/automattic/vip-codespaces/alpine-base:latest", + "overrideCommand": false, + "features": { + "base": {}, + "nginx": { + "mediaRedirectURL": "" + }, + "php": { + "version": "8.4", + "composer": true + }, + "mariadb": { + "installDatabaseToWorkspaces": true + }, + "wordpress": { + "version": "latest", + "moveUploadsToWorkspaces": true, + "multisite": true, + "multisiteStyle": "subdirectory" + }, + "wp-cli": { + "nightly": false + }, + "vip-go-mu-plugins": { + "enabled": true, + "development_mode": false + }, + "dev-tools": {}, + "elasticsearch": { + "enabled": true, + "installDataToWorkspaces": true + }, + "memcached": { + "enabled": true + }, + "vip-cli": { + "enabled": true + }, + "mailpit": { + "enabled": true + }, + "phpmyadmin": { + "enabled": true + }, + "xdebug": { + "enabled": true, + "mode": "debug,develop" + }, + "mc": { + "enabled": true + }, + "photon": { + "enabled": true, + "disable_optimizations": false + }, + "cron": { + "enabled": true, + "run_wp_cron": true, + "wp_cron_schedule": "*/15 * * * *" + }, + "wptl": { + "enabled": true, + "version": "latest" + } + }, + "overrideFeatureInstallOrder": [ + "./base", + "./wp-cli", + "./mariadb", + "./mc", + "./nginx", + "./php", + "./vip-cli", + "./wordpress", + "./cron", + "./elasticsearch", + "./mailpit", + "./memcached", + "./photon", + "./phpmyadmin", + "./vip-go-mu-plugins", + "./xdebug", + "./dev-tools" + ] + }, "php81-ubuntu-base": { "image": "ghcr.io/automattic/vip-codespaces/ubuntu-base:latest", @@ -539,5 +625,99 @@ "./playwright", "./desktop-lite" ] + }, + "php84-ubuntu-base": { + "image": "ghcr.io/automattic/vip-codespaces/ubuntu-base:latest", + "overrideCommand": false, + "features": { + "base": {}, + "nginx": { + "mediaRedirectURL": "" + }, + "php": { + "version": "8.4", + "composer": true + }, + "mariadb": { + "installDatabaseToWorkspaces": true + }, + "wordpress": { + "version": "latest", + "moveUploadsToWorkspaces": true, + "multisite": true, + "multisiteStyle": "subdirectory" + }, + "wp-cli": { + "nightly": false + }, + "vip-go-mu-plugins": { + "enabled": true, + "development_mode": false + }, + "dev-tools": {}, + "elasticsearch": { + "enabled": true, + "installDataToWorkspaces": true + }, + "memcached": { + "enabled": true + }, + "vip-cli": { + "enabled": true + }, + "mailpit": { + "enabled": true + }, + "phpmyadmin": { + "enabled": true + }, + "xdebug": { + "enabled": true, + "mode": "debug,develop" + }, + "mc": { + "enabled": true + }, + "photon": { + "enabled": true, + "disable_optimizations": false + }, + "cron": { + "enabled": true, + "run_wp_cron": true, + "wp_cron_schedule": "*/15 * * * *" + }, + "playwright": { + "enabled": true + }, + "wptl": { + "enabled": true, + "version": "latest" + }, + "desktop-lite": { + "enabled": true + } + }, + "overrideFeatureInstallOrder": [ + "./base", + "./wp-cli", + "./mariadb", + "./mc", + "./nginx", + "./php", + "./vip-cli", + "./wordpress", + "./cron", + "./elasticsearch", + "./mailpit", + "./memcached", + "./photon", + "./phpmyadmin", + "./vip-go-mu-plugins", + "./xdebug", + "./dev-tools", + "./playwright", + "./desktop-lite" + ] } } diff --git a/features/test/php/alpine-84-mcr.sh b/features/test/php/alpine-84-mcr.sh new file mode 120000 index 00000000..81058609 --- /dev/null +++ b/features/test/php/alpine-84-mcr.sh @@ -0,0 +1 @@ +alpine-81.sh \ No newline at end of file diff --git a/features/test/php/alpine-84.sh b/features/test/php/alpine-84.sh new file mode 120000 index 00000000..81058609 --- /dev/null +++ b/features/test/php/alpine-84.sh @@ -0,0 +1 @@ +alpine-81.sh \ No newline at end of file diff --git a/features/test/php/scenarios.json b/features/test/php/scenarios.json index b1437948..738641fb 100644 --- a/features/test/php/scenarios.json +++ b/features/test/php/scenarios.json @@ -56,6 +56,25 @@ "./vip-cli" ] }, + "alpine-84": { + "image": "ghcr.io/automattic/vip-codespaces/alpine-base:latest", + "overrideCommand": false, + "features": { + "php": { + "version": "8.4", + "composer": true + }, + "mailpit": {}, + "vip-cli": {}, + "xdebug": {} + }, + "overrideFeatureInstallOrder": [ + "./php", + "./xdebug", + "./mailpit", + "./vip-cli" + ] + }, "ubuntu-81": { "image": "ghcr.io/automattic/vip-codespaces/ubuntu-base:latest", @@ -120,6 +139,27 @@ "./vip-cli" ] }, + "ubuntu-84": { + "image": "ghcr.io/automattic/vip-codespaces/ubuntu-base:latest", + "overrideCommand": false, + "features": { + "base": {}, + "php": { + "version": "8.4", + "composer": true + }, + "mailpit": {}, + "vip-cli": {}, + "xdebug": {} + }, + "overrideFeatureInstallOrder": [ + "./base", + "./php", + "./xdebug", + "./mailpit", + "./vip-cli" + ] + }, "ubuntu-81-mcr": { "image": "mcr.microsoft.com/devcontainers/base:ubuntu", @@ -199,6 +239,32 @@ "./vip-cli" ] }, + "ubuntu-84-mcr": { + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", + "features": { + "base": {}, + "entrypoints": {}, + "php": { + "version": "8.3", + "composer": true, + "install-runit-service": false, + "lite-install": true + }, + "mailpit": { + "install-runit-service": false + }, + "vip-cli": {}, + "xdebug": {} + }, + "overrideFeatureInstallOrder": [ + "./base", + "./entrypoints", + "./php", + "./xdebug", + "./mailpit", + "./vip-cli" + ] + }, "alpine-81-mcr": { "image": "mcr.microsoft.com/devcontainers/base:alpine", @@ -274,5 +340,30 @@ "./mailpit", "./vip-cli" ] + }, + "alpine-84-mcr": { + "image": "mcr.microsoft.com/devcontainers/base:alpine", + "features": { + "entrypoints": {}, + "php": { + "version": "8.4", + "composer": true, + "install-runit-service": false, + "lite-install": true, + "skip-gmagick": true + }, + "mailpit": { + "install-runit-service": false + }, + "vip-cli": {}, + "xdebug": {} + }, + "overrideFeatureInstallOrder": [ + "./entrypoints", + "./php", + "./xdebug", + "./mailpit", + "./vip-cli" + ] } } diff --git a/features/test/php/ubuntu-84-mcr.sh b/features/test/php/ubuntu-84-mcr.sh new file mode 120000 index 00000000..ab5a3ce6 --- /dev/null +++ b/features/test/php/ubuntu-84-mcr.sh @@ -0,0 +1 @@ +ubuntu-81.sh \ No newline at end of file diff --git a/features/test/php/ubuntu-84.sh b/features/test/php/ubuntu-84.sh new file mode 120000 index 00000000..ab5a3ce6 --- /dev/null +++ b/features/test/php/ubuntu-84.sh @@ -0,0 +1 @@ +ubuntu-81.sh \ No newline at end of file