diff --git a/tests/unit/data/travis/README.md b/tests/unit/data/travis/README.md index e87ebe4..c86497e 100644 --- a/tests/unit/data/travis/README.md +++ b/tests/unit/data/travis/README.md @@ -4,6 +4,8 @@ These scripts might be used to configure your own system for test runs. But sinc The scripts are: + - [`apc-setup.sh`](apc-setup.sh) + Installs and configures the [apc pecl extension](http://pecl.php.net/package/apc) - [`memcache-setup.sh`](memcache-setup.sh) Compiles and installs the [memcache pecl extension](http://pecl.php.net/package/memcache) - [`cubrid-setup.sh`](cubrid-setup.sh) diff --git a/tests/unit/data/travis/apc-setup.sh b/tests/unit/data/travis/apc-setup.sh new file mode 100755 index 0000000..3355f8f --- /dev/null +++ b/tests/unit/data/travis/apc-setup.sh @@ -0,0 +1,2 @@ +echo "extension = .so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini +echo "apc.enable_cli = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini \ No newline at end of file diff --git a/tests/unit/data/travis/memcache-setup.sh b/tests/unit/data/travis/memcache-setup.sh new file mode 100755 index 0000000..d0a9888 --- /dev/null +++ b/tests/unit/data/travis/memcache-setup.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +install_memcache() { + if [ "$(expr "$TRAVIS_PHP_VERSION" ">=" "5.5")" -eq 1 ]; then + MEMCACHE_VERSION="2.2.7" + wget "http://pecl.php.net/get/memcache-$MEMCACHE_VERSION.tgz" && + tar -zxf "memcache-$MEMCACHE_VERSION.tgz" && + sh -c "cd memcache-$MEMCACHE_VERSION && phpize && ./configure --enable-memcache && make && sudo make install" + fi + + echo "extension=memcache.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini + + return $? +} + +install_memcache > ~/memcache.log || ( echo "=== MEMCACHE BUILD FAILED ==="; cat ~/memcache.log ) \ No newline at end of file