From a01229346288cbb3118adf159000f51260733606 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Mon, 27 Jan 2014 01:17:26 +0100 Subject: [PATCH 1/7] [ticket/11985] Reorganise travis/install-php-extensions.sh PHPBB3-11985 --- travis/install-php-extensions.sh | 34 ++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/travis/install-php-extensions.sh b/travis/install-php-extensions.sh index 55955c2905..908dcdf7f3 100755 --- a/travis/install-php-extensions.sh +++ b/travis/install-php-extensions.sh @@ -4,18 +4,32 @@ # @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 # set -e +set -x -function add_ext_to_php_ini +function find_php_ini { - echo "extension=$1.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` + echo $(php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||") } +# $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 .. + + echo "extension=$1.so" >> "$2" +} + +php_ini_file=$(find_php_ini) + # redis -git clone git://github.com/nicolasff/phpredis.git -cd phpredis -phpize -./configure -make -make install -cd .. -add_ext_to_php_ini 'redis' +git clone git://github.com/nicolasff/phpredis.git redis +install_php_extension 'redis' "$php_ini_file" From 3b6542adf8d20acdbe400c2547121a1da86a855e Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Mon, 27 Jan 2014 01:17:54 +0100 Subject: [PATCH 2/7] [ticket/11985] Enable APC on command line so it can be used by PHPUnit. PHPBB3-11985 --- travis/install-php-extensions.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/travis/install-php-extensions.sh b/travis/install-php-extensions.sh index 908dcdf7f3..11d5fad944 100755 --- a/travis/install-php-extensions.sh +++ b/travis/install-php-extensions.sh @@ -11,6 +11,13 @@ 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 @@ -25,11 +32,16 @@ function install_php_extension make install cd .. - echo "extension=$1.so" >> "$2" + register_php_extension "$1" "$2" } php_ini_file=$(find_php_ini) +# apc +echo 'Enabling APC PHP extension' +register_php_extension 'apc' "$php_ini_file" +echo 'apc.enable_cli=1' >> "$php_ini_file" + # redis git clone git://github.com/nicolasff/phpredis.git redis install_php_extension 'redis' "$php_ini_file" From b16448b3f83176c6468074e0e55709edc5791c2e Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Mon, 3 Feb 2014 15:38:49 +0100 Subject: [PATCH 3/7] [ticket/11985] Don't try to install APC on PHP 5.5 or higher. PHPBB3-11985 --- travis/install-php-extensions.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/travis/install-php-extensions.sh b/travis/install-php-extensions.sh index 11d5fad944..18d6e7e09d 100755 --- a/travis/install-php-extensions.sh +++ b/travis/install-php-extensions.sh @@ -38,9 +38,12 @@ function install_php_extension php_ini_file=$(find_php_ini) # apc -echo 'Enabling APC PHP extension' -register_php_extension 'apc' "$php_ini_file" -echo 'apc.enable_cli=1' >> "$php_ini_file" +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 From 116ff19185fd50a30abdc04a8200c330589088d4 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Mon, 3 Feb 2014 22:09:33 +0100 Subject: [PATCH 4/7] [ticket/11985] Rename install -> setup. This is more generic and consistent. PHPBB3-11985 --- .travis.yml | 2 +- travis/{install-php-extensions.sh => setup-php-extensions.sh} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename travis/{install-php-extensions.sh => setup-php-extensions.sh} (100%) diff --git a/.travis.yml b/.travis.yml index 8323bd81ad..a97e25240a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,7 @@ services: install: - sh -c "if [ '$DB' = 'mariadb' ]; then travis/setup-mariadb.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 + - travis/setup-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/setup-php-extensions.sh similarity index 100% rename from travis/install-php-extensions.sh rename to travis/setup-php-extensions.sh From b6d45c5d71dcec6d1c60fc6919d969d1e8b274bd Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 4 Feb 2014 00:13:36 +0100 Subject: [PATCH 5/7] [ticket/11985] Do not try to setup PHP extensions on HHVM. PHPBB3-11985 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a97e25240a..cbc5b63bff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,7 @@ services: install: - sh -c "if [ '$DB' = 'mariadb' ]; then travis/setup-mariadb.sh; fi" - sh -c "if [ `php -r "echo (int) version_compare(PHP_VERSION, '5.3.19', '>=');"` = "1" ]; then travis/setup-webserver.sh; fi" - - travis/setup-php-extensions.sh + - sh -c "if [ '$TRAVIS_PHP_VERSION' != 'hhvm' ]; then travis/setup-php-extensions.sh; fi" - cd phpBB - php ../composer.phar install --dev --no-interaction --prefer-source - cd .. From ac954a7c4b6daefe1efcc4ebe047c8818ca4497a Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 4 Feb 2014 01:38:43 +0100 Subject: [PATCH 6/7] [ticket/12141] PHP extension setup must happen before webserver + PHP-FPM. PHPBB3-12141 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index cbc5b63bff..79a6635cbc 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 [ `php -r "echo (int) version_compare(PHP_VERSION, '5.3.19', '>=');"` = "1" ]; then travis/setup-webserver.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" - cd phpBB - php ../composer.phar install --dev --no-interaction --prefer-source - cd .. From cb544ed7ae04a44c305b252644b8c6bc40f6e2dc Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Mon, 3 Feb 2014 22:26:00 +0100 Subject: [PATCH 7/7] [ticket/12141] Disable broken opcache extension on PHP 5.5.7. PHPBB3-12141 --- travis/setup-php-extensions.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/travis/setup-php-extensions.sh b/travis/setup-php-extensions.sh index 18d6e7e09d..ebfe62839c 100755 --- a/travis/setup-php-extensions.sh +++ b/travis/setup-php-extensions.sh @@ -37,6 +37,12 @@ function install_php_extension 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