File tree Expand file tree Collapse file tree 3 files changed +33
-17
lines changed
Expand file tree Collapse file tree 3 files changed +33
-17
lines changed Original file line number Diff line number Diff line change @@ -326,11 +326,6 @@ cmd buildah run "$CONTAINER" -- \
326326 " /usr/local/bin/pie-latest" " 99"
327327
328328for PHP_MILESTONE in " ${PHP_MILESTONES[@]} " ; do
329- case " $PHP_MILESTONE " in
330- " 5.6" |" 7.0" |" 7.1" |" 7.2" |" 7.3" |" 7.4" |" 8.0" ) continue ;;
331- * ) ;;
332- esac
333-
334329 echo + " ln -s pie-php $( quote " …/usr/local/bin/pie-php$PHP_MILESTONE " ) " >&2
335330 ln -s pie-php " $MOUNT /usr/local/bin/pie-php$PHP_MILESTONE "
336331
@@ -339,13 +334,8 @@ for PHP_MILESTONE in "${PHP_MILESTONES[@]}"; do
339334 " /usr/local/bin/pie-php$PHP_MILESTONE " " ${PHP_MILESTONE// ./ } "
340335done
341336
342- if [ -e " $MOUNT /usr/local/bin/pie-php$PHP_LATEST_MILESTONE " ]; then
343- cmd buildah run " $CONTAINER " -- \
344- update-alternatives --set pie " /usr/local/bin/pie-php$PHP_LATEST_MILESTONE "
345- else
346- cmd buildah run " $CONTAINER " -- \
347- update-alternatives --auto pie
348- fi
337+ cmd buildah run " $CONTAINER " -- \
338+ update-alternatives --set pie " /usr/local/bin/pie-php$PHP_LATEST_MILESTONE "
349339
350340# install Composer
351341php_composer_install " $CONTAINER " " latest-stable" " /usr/local/bin/composer-latest"
Original file line number Diff line number Diff line change @@ -85,9 +85,7 @@ if [ "$1" == "php-fpm" ]; then
8585 [ ! -e " /etc/php/$PHP_MILESTONE /fpm/pool.d/www.conf" ] \
8686 || update-alternatives --quiet --set php-fpm_www.sock " /run/php-fpm/$PHP_MILESTONE /php-fpm_www.sock"
8787
88- [ -e " /usr/local/bin/pie-php$PHP_MILESTONE " ] \
89- && update-alternatives --quiet --set pie " /usr/local/bin/pie-php$PHP_MILESTONE " \
90- || update-alternatives --quiet --auto pie
88+ update-alternatives --quiet --set pie " /usr/local/bin/pie-php$PHP_MILESTONE "
9189 update-alternatives --quiet --set composer " /usr/local/bin/composer-php$PHP_MILESTONE "
9290 update-alternatives --quiet --set phive " /usr/local/bin/phive-php$PHP_MILESTONE "
9391 fi
Original file line number Diff line number Diff line change 1212
1313PHP=" php"
1414PIE=" pie-latest"
15+ PIE_ARGS=()
1516
1617if [[ " $( basename " $0 " ) " =~ ^pie-(php[0-9]\. [0-9])$ ]]; then
1718 PHP=" ${BASH_REMATCH[1]} "
18- # PIE never supported anything else than PHP 8.1+ only
19+
20+ case " $PHP " in
21+ " php5.6" |" php7.0" |" php7.1" |" php7.2" |" php7.3" |" php7.4" |" php8.0" )
22+ # PIE itself must run with PHP 8.1 and later, but it can install extensions for any PHP version
23+ # in case of such old PHP version, run PIE with PHP 8.1 (earliest supported version)
24+ # and tell PIE what `php-config` and `phpize` binaries to use instead
25+ PHP_VERSION=" ${PHP: 3} "
26+
27+ PHP_CONFIG=" php-config$PHP_VERSION "
28+ PHP_CONFIG_PATH=" $( type -P " $PHP_CONFIG " 2> /dev/null) "
29+ [ -n " $PHP_CONFIG_PATH " ] && [ -x " $PHP_CONFIG_PATH " ] \
30+ || { echo " Invalid php-config executable \` $PHP_CONFIG \` : No such executable" >&2 ; exit 1; }
31+
32+ PHPIZE=" phpize$PHP_VERSION "
33+ PHPIZE_PATH=" $( type -P " $PHPIZE " 2> /dev/null) "
34+ [ -n " $PHPIZE_PATH " ] && [ -x " $PHPIZE_PATH " ] \
35+ || { echo " Invalid phpize executable \` $PHPIZE \` : No such executable" >&2 ; exit 1; }
36+
37+ PIE_ARGS+=(
38+ --with-php-config=" $PHP_CONFIG_PATH "
39+ --with-phpize-path=" $PHPIZE_PATH "
40+ )
41+
42+ PHP=" php8.1"
43+ ;;
44+
45+ * ) ;;
46+ esac
1947fi
2048
2149PHP_PATH=" $( type -P " $PHP " 2> /dev/null) "
@@ -26,4 +54,4 @@ PIE_PATH="$(type -P "$PIE" 2> /dev/null)"
2654[ -n " $PIE_PATH " ] && [ -x " $PIE_PATH " ] \
2755 || { echo " Invalid PIE executable \` $PIE \` : No such executable" >&2 ; exit 1; }
2856
29- exec " $PHP_PATH " -f " $PIE_PATH " -- " $@ "
57+ exec " $PHP_PATH " -f " $PIE_PATH " -- " ${PIE_ARGS[@]} " " $ @"
You can’t perform that action at this time.
0 commit comments