diff options
author | Nils Adermann <naderman@naderman.de> | 2014-02-04 02:57:35 -0800 |
---|---|---|
committer | Nils Adermann <naderman@naderman.de> | 2014-02-04 02:57:35 -0800 |
commit | db9fd30e7c74f5812e38270123656926f02173fa (patch) | |
tree | 0a3d2022bcb1a40de2f3ac72b1c7f0f44ba5e9ae | |
parent | d50b8df36483a3f3dbee2f701c80b84368133537 (diff) | |
parent | cb544ed7ae04a44c305b252644b8c6bc40f6e2dc (diff) | |
download | forums-db9fd30e7c74f5812e38270123656926f02173fa.tar forums-db9fd30e7c74f5812e38270123656926f02173fa.tar.gz forums-db9fd30e7c74f5812e38270123656926f02173fa.tar.bz2 forums-db9fd30e7c74f5812e38270123656926f02173fa.tar.xz forums-db9fd30e7c74f5812e38270123656926f02173fa.zip |
Merge pull request #1998 from bantu/ticket/12141
[ticket/12141] Disable opcache extension on PHP 5.5.7
-rw-r--r-- | .travis.yml | 2 | ||||
-rwxr-xr-x | travis/install-php-extensions.sh | 21 | ||||
-rwxr-xr-x | travis/setup-php-extensions.sh | 56 |
3 files changed, 57 insertions, 22 deletions
diff --git a/.travis.yml b/.travis.yml index 4f4705e4f7..aecd097370 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,8 +16,8 @@ services: install: - sh -c "if [ '$DB' = 'mariadb' ]; then travis/setup-mariadb.sh; fi" + - sh -c "if [ '$TRAVIS_PHP_VERSION' != 'hhvm' ]; then travis/setup-php-extensions.sh; fi" - sh -c "if [ `php -r "echo (int) version_compare(PHP_VERSION, '5.3.19', '>=');"` = "1" ]; then travis/setup-webserver.sh; fi" - - travis/install-php-extensions.sh - cd phpBB - php ../composer.phar install --dev --no-interaction --prefer-source - cd .. diff --git a/travis/install-php-extensions.sh b/travis/install-php-extensions.sh deleted file mode 100755 index 55955c2905..0000000000 --- a/travis/install-php-extensions.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -# -# @copyright (c) 2013 phpBB Group -# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 -# -set -e - -function add_ext_to_php_ini -{ - echo "extension=$1.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` -} - -# redis -git clone git://github.com/nicolasff/phpredis.git -cd phpredis -phpize -./configure -make -make install -cd .. -add_ext_to_php_ini 'redis' diff --git a/travis/setup-php-extensions.sh b/travis/setup-php-extensions.sh new file mode 100755 index 0000000000..ebfe62839c --- /dev/null +++ b/travis/setup-php-extensions.sh @@ -0,0 +1,56 @@ +#!/bin/bash +# +# @copyright (c) 2013 phpBB Group +# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +# +set -e +set -x + +function find_php_ini +{ + echo $(php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||") +} + +# $1 - PHP extension name +# $2 - PHP ini file path +function register_php_extension +{ + echo "extension=$1.so" >> "$2" +} + +# $1 - PHP extension name +# $2 - PHP ini file path +function install_php_extension +{ + echo "Installing $1 PHP extension" + + # See http://www.php.net/manual/en/install.pecl.phpize.php + cd "$1" + phpize + ./configure + make + make install + cd .. + + register_php_extension "$1" "$2" +} + +php_ini_file=$(find_php_ini) + +# disable broken opcache on PHP 5.5.7 +if [ `php -r "echo (int) version_compare(PHP_VERSION, '5.5.8', '<');"` == "1" ] +then + sed -i '/opcache.so/d' "$php_ini_file" +fi + +# apc +if [ `php -r "echo (int) version_compare(PHP_VERSION, '5.5.0-dev', '<');"` == "1" ] +then + echo 'Enabling APC PHP extension' + register_php_extension 'apc' "$php_ini_file" + echo 'apc.enable_cli=1' >> "$php_ini_file" +fi + +# redis +git clone git://github.com/nicolasff/phpredis.git redis +install_php_extension 'redis' "$php_ini_file" |