[ticket/15935] Don't install APCu if it's already installed

Travis fails when the APCu install fails due to it already being installed
A check is added here to make sure that it does nothing in that case

PHPBB3-15935
This commit is contained in:
Alec 2019-01-12 15:21:43 -05:00
parent b8cc0c77a2
commit 64b6f9055a

View file

@ -49,10 +49,13 @@ echo 'opcache.enable=0' >> "$php_ini_file"
# APCu
if [ `php -r "echo (int) (version_compare(PHP_VERSION, '7.0.0-dev', '>=') && version_compare(PHP_VERSION, '7.3.0-dev', '<'));"` == "1" ]
then
echo 'Enabling APCu PHP extension'
printf "\n" | pecl install apcu
echo 'apc.enabled=1' >> "$php_ini_file"
echo 'apc.enable_cli=1' >> "$php_ini_file"
if ! [ "$(pecl info pecl/apcu)" ]
then
echo 'Enabling APCu PHP extension'
printf "\n" | pecl install apcu
echo 'apc.enabled=1' >> "$php_ini_file"
echo 'apc.enable_cli=1' >> "$php_ini_file"
fi
fi