Skip to content

Commit 555742a

Browse files
committed
PHPLIB-324: Cache extension installation for Travis CI jobs
1 parent 07ffd24 commit 555742a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

.travis.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,22 @@ before_install:
4646
- mongod --version
4747
- mongo-orchestration --version
4848
- export MO_PATH=`python -c 'import mongo_orchestration; from os import path; print(path.dirname(mongo_orchestration.__file__));'`
49+
- |
50+
# tpecl is a helper to compile and cache php extensions
51+
tpecl () {
52+
local ext_name=ext-mongodb
53+
local ext_so=mongodb.so
54+
local ext_dir=$(php -r "echo ini_get('extension_dir');")
55+
local ext_cache=~/php-ext/$(basename $ext_dir)/$ext_name
56+
if [[ -e $ext_cache/$ext_so ]]; then
57+
echo extension = $ext_cache/$ext_so >> $INI
58+
else
59+
mkdir -p $ext_cache
60+
echo yes | pecl install -f $ext_name &&
61+
cp $ext_dir/$ext_so $ext_cache
62+
fi
63+
}
64+
export -f tpecl
4965
5066
before_script:
5167
- mongo-orchestration start

0 commit comments

Comments
 (0)