File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,6 +24,14 @@ get() {
2424 fi
2525}
2626
27+ sudo_php_env () {
28+ sudo env \
29+ ASAN_OPTIONS=" ${ASAN_OPTIONS:- } " \
30+ UBSAN_OPTIONS=" ${UBSAN_OPTIONS:- } " \
31+ ZEND_DONT_UNLOAD_MODULES=" ${ZEND_DONT_UNLOAD_MODULES:- } " \
32+ " $@ "
33+ }
34+
2735set_base_version_id () {
2836 [[ " $ID " =~ ubuntu| debian ]] && return ;
2937 if ! [ -d " $dist_info_dir " ]; then
@@ -298,10 +306,10 @@ add_prerequisites() {
298306add_pear () {
299307 if ! [ -e /usr/bin/pear ]; then
300308 sudo curl -o /tmp/pear.phar -sL https://raw.githubusercontent.com/pear/pearweb_phars/master/install-pear-nozlib.phar
301- sudo php /tmp/pear.phar && sudo rm -f /tmp/pear.phar
309+ sudo_php_env php /tmp/pear.phar && sudo rm -f /tmp/pear.phar
302310 to_wait=()
303311 for script in pear pecl; do
304- sudo " $script " channel-update " $script " .php.net &
312+ sudo_php_env " $script " channel-update " $script " .php.net &
305313 to_wait+=(" $! " )
306314 done
307315 wait " ${to_wait[@]} "
@@ -403,7 +411,9 @@ configure() {
403411 done
404412 fi
405413 sudo chmod 777 " $pecl_file "
406- echo system user | xargs -n1 sudo pear config-set php_ini " $pecl_file "
414+ for pear_scope in system user; do
415+ sudo_php_env pear config-set php_ini " $pecl_file " " $pear_scope "
416+ done
407417 echo ' ' | sudo tee /tmp/pecl_config > /dev/null 2>&1
408418 if [ -d /run/systemd/system ]; then
409419 sudo systemctl daemon-reload 2> /dev/null || true
Original file line number Diff line number Diff line change 1+ sudo_php_env () {
2+ sudo env \
3+ ASAN_OPTIONS=" ${ASAN_OPTIONS:- } " \
4+ UBSAN_OPTIONS=" ${UBSAN_OPTIONS:- } " \
5+ ZEND_DONT_UNLOAD_MODULES=" ${ZEND_DONT_UNLOAD_MODULES:- } " \
6+ " $@ "
7+ }
8+
19if [ " $PHP_VERSION " = " 5.6" ]; then
2- sudo pecl install -f psr-0.6.0
10+ sudo_php_env pecl install -f psr-0.6.0
311elif [[ " $PHP_VERSION " =~ 7.[0-2]$ ]]; then
4- sudo pecl install -f psr-1.1.0
12+ sudo_php_env pecl install -f psr-1.1.0
513else
6- sudo pecl install -f psr
14+ sudo_php_env pecl install -f psr
715fi
816php -m | grep -q psr || exit 1
You can’t perform that action at this time.
0 commit comments