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 /travis/setup-php-extensions.sh | |
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
Diffstat (limited to 'travis/setup-php-extensions.sh')
-rwxr-xr-x | travis/setup-php-extensions.sh | 56 |
1 files changed, 56 insertions, 0 deletions
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" |