Skip to content

Commit

Permalink
Merge pull request #117 from Automattic/GH-116
Browse files Browse the repository at this point in the history
fix(php): redirect PHP 8.0 to 8.1
  • Loading branch information
sjinks authored Nov 12, 2023
2 parents c114701 + 9809fc6 commit 94de210
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 141 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,15 +2,15 @@
"id": "php",
"name": "PHP",
"description": "Installs PHP into the Dev Environment",
"version": "2.2.3",
"version": "2.2.4",
"containerEnv": {
"PHP_INI_DIR": "/etc/php"
},
"options": {
"version": {
"type": "string",
"enum": ["8.0", "8.1", "8.2", "8.3"],
"default": "8.0",
"default": "8.2",
"description": "PHP version"
},
"composer": {
Expand Down
80 changes: 6 additions & 74 deletions features/src/php/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,68 +4,6 @@ set -e

PATH=/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin

setup_php80() {
apk add --no-cache \
icu-data-full@edgem icu-libs@edgem libssl3@edgem libsodium@edgem ghostscript \
php8@edget \
php8-fpm@edget \
php8-pear@edget \
php8-pecl-apcu@edget \
php8-bcmath@edget \
php8-calendar@edget \
php8-ctype@edget \
php8-curl@edget \
php8-dom@edget \
php8-exif@edget \
php8-fileinfo@edget \
php8-ftp@edget \
php8-gd@edget \
php8-pecl-gmagick@edget \
php8-gmp@edget \
php8-iconv@edget \
php8-intl@edget \
php8-json@edget \
php8-mbstring@edget \
php8-pecl-igbinary@edget \
php8-pecl-mcrypt@edget \
php8-pecl-memcache@edget \
php8-pecl-memcached@edget \
php8-mysqli@edget \
php8-mysqlnd@edget \
php8-opcache@edget \
php8-openssl@edget \
php8-pcntl@edget \
php8-pdo@edget \
php8-pdo_sqlite@edget \
php8-phar@edget \
php8-posix@edget \
php8-session@edget \
php8-shmop@edget \
php8-simplexml@edget \
php8-soap@edget \
php8-sockets@edget \
php8-sodium@edget \
php8-sqlite3@edget \
php8-pecl-ssh2@edget \
php8-sysvsem@edget \
php8-sysvshm@edget \
php8-pecl-timezonedb@edget \
php8-tokenizer@edget \
php8-xml@edget \
php8-xmlreader@edget \
php8-xmlwriter@edget \
php8-zip@edget

[ ! -f /usr/sbin/php-fpm ] && ln -s /usr/sbin/php-fpm8 /usr/sbin/php-fpm
[ ! -f /usr/bin/php ] && ln -s /usr/bin/php8 /usr/bin/php
[ ! -f /usr/bin/pecl ] && ln -s /usr/bin/pecl8 /usr/bin/pecl
[ ! -f /usr/bin/pear ] && ln -s /usr/bin/pear8 /usr/bin/pear
[ ! -f /usr/bin/peardev ] && ln -s /usr/bin/peardev8 /usr/bin/peardev
[ ! -f /usr/bin/phar ] && ln -s /usr/bin/phar8 /usr/bin/phar
[ ! -f /usr/bin/phar.phar ] && ln -s /usr/bin/phar8 /usr/bin/phar.phar
true
}

setup_php81() {
apk add --no-cache \
icu-data-full ghostscript \
Expand All @@ -86,7 +24,7 @@ setup_php81() {
php81-json \
php81-mbstring \
php81-pecl-igbinary@edgec \
php81-pecl-mcrypt@edget \
php81-pecl-mcrypt@edgec \
php81-pecl-memcache \
php81-pecl-memcached \
php81-mysqli \
Expand All @@ -108,7 +46,7 @@ setup_php81() {
php81-pecl-ssh2 \
php81-sysvsem \
php81-sysvshm \
php81-pecl-timezonedb@edget \
php81-pecl-timezonedb@edgec \
php81-tokenizer \
php81-xml \
php81-xmlreader \
Expand Down Expand Up @@ -153,7 +91,7 @@ setup_php82() {
php82-pecl-igbinary@edgec \
php82-pecl-memcache@edgec \
php82-pecl-memcached@edgec \
php82-pecl-mcrypt@edget \
php82-pecl-mcrypt@edgec \
php82-mysqli@edgec \
php82-mysqlnd@edgec \
php82-opcache@edgec \
Expand All @@ -172,7 +110,7 @@ setup_php82() {
php82-sqlite3@edgec \
php82-sysvsem@edgec \
php82-sysvshm@edgec \
php82-pecl-timezonedb@edget \
php82-pecl-timezonedb@edgec \
php82-tokenizer@edgec \
php82-xml@edgec \
php82-xmlreader@edgec \
Expand Down Expand Up @@ -277,14 +215,8 @@ fi

echo "(*) Installing PHP ${VERSION}..."
case "${VERSION}" in
"8.0")
setup_php80
echo "export PHP_INI_DIR=/etc/php8" > /etc/profile.d/php_ini_dir.sh
PHP_INI_DIR=/etc/php8
ln -sf /etc/php8 /etc/php
;;

"8.1")
"8.0"|"8.1")
VERSION="8.1"
setup_php81
echo "export PHP_INI_DIR=/etc/php81" > /etc/profile.d/php_ini_dir.sh
PHP_INI_DIR=/etc/php81
Expand Down
65 changes: 0 additions & 65 deletions test/devcontainer-php80.json

This file was deleted.

0 comments on commit 94de210

Please sign in to comment.