Skip to content

Commit

Permalink
feat: add PHP 8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
sjinks committed Nov 24, 2024
1 parent b239fdd commit 336d510
Show file tree
Hide file tree
Showing 4 changed files with 143 additions and 2 deletions.
4 changes: 2 additions & 2 deletions features/src/php/devcontainer-feature.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
46 changes: 46 additions & 0 deletions features/src/php/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,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
Expand Down Expand Up @@ -423,6 +464,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
Expand Down
1 change: 1 addition & 0 deletions features/test/_global/php84-ubuntu-base.sh
94 changes: 94 additions & 0 deletions features/test/_global/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -539,5 +539,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"
]
}
}

0 comments on commit 336d510

Please sign in to comment.