aboutsummaryrefslogtreecommitdiffstats
path: root/travis
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2014-01-27 01:17:26 +0100
committerAndreas Fischer <bantu@phpbb.com>2014-02-03 15:33:46 +0100
commita01229346288cbb3118adf159000f51260733606 (patch)
tree6db2ff018c810f9233d6e0dfa2b5e4518816077e /travis
parent1f93d940fd40f9660676cb20e401f5b092bdf873 (diff)
downloadforums-a01229346288cbb3118adf159000f51260733606.tar
forums-a01229346288cbb3118adf159000f51260733606.tar.gz
forums-a01229346288cbb3118adf159000f51260733606.tar.bz2
forums-a01229346288cbb3118adf159000f51260733606.tar.xz
forums-a01229346288cbb3118adf159000f51260733606.zip
[ticket/11985] Reorganise travis/install-php-extensions.sh
PHPBB3-11985
Diffstat (limited to 'travis')
-rwxr-xr-xtravis/install-php-extensions.sh34
1 files 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"