Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Merge 9470ad7 into a98e563
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanotorresi committed May 27, 2016
2 parents a98e563 + 9470ad7 commit 4b8a6fc
Show file tree
Hide file tree
Showing 11 changed files with 2,393 additions and 92 deletions.
2 changes: 2 additions & 0 deletions .ci/apcu.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
extension=apcu.so
apc.enable_cli = 1
2 changes: 2 additions & 0 deletions .ci/apcu_bc.ini
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
extension=apcu.so
extension=apc.so
apc.enable_cli = 1
1 change: 1 addition & 0 deletions .ci/memcache.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extension=memcache.so
1 change: 1 addition & 0 deletions .ci/memcached.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extension=memcached.so
1 change: 1 addition & 0 deletions .ci/mongo.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extension=mongo.so
6 changes: 0 additions & 6 deletions .ci/php.ini

This file was deleted.

1 change: 1 addition & 0 deletions .ci/redis.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extension=redis.so
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ nbproject
doc/html/
tmp/
zf-mkdoc-theme/

clover.xml
composer.lock
coveralls-upload.json
phpunit.xml
vendor
207 changes: 125 additions & 82 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,84 +20,99 @@ services:

env:
global:
- TESTS_ZEND_CACHE_APC_ENABLED: true
- TESTS_ZEND_CACHE_APC_ENABLED=true
- TESTS_ZEND_CACHE_APCU_ENABLED=true
- TESTS_ZEND_CACHE_FILESYSTEM_DIR: /dev/shm
- TESTS_ZEND_CACHE_MEMCACHED_ENABLED: true
- TESTS_ZEND_CACHE_MEMCACHED_HOST: "127.0.0.1"
- TESTS_ZEND_CACHE_MEMCACHED_PORT: 11211
- TESTS_ZEND_CACHE_MEMCACHE_ENABLED: true
- TESTS_ZEND_CACHE_MEMCACHE_HOST: $TESTS_ZEND_CACHE_MEMCACHED_HOST
- TESTS_ZEND_CACHE_MEMCACHE_PORT: $TESTS_ZEND_CACHE_MEMCACHED_PORT
- TESTS_ZEND_CACHE_MONGODB_ENABLED: true
- TESTS_ZEND_CACHE_REDIS_ENABLED: true
- TESTS_ZEND_CACHE_REDIS_HOST: "127.0.0.1"
- TESTS_ZEND_CACHE_REDIS_PORT: 6379
- TESTS_ZEND_CACHE_REDIS_PASSWORD: ""
- TESTS_ZEND_CACHE_REDIS_DATABASE: 0
- TESTS_ZEND_CACHE_FILESYSTEM_DIR=/dev/shm
- TESTS_ZEND_CACHE_MEMCACHED_ENABLED=true
- TESTS_ZEND_CACHE_MEMCACHED_HOST="127.0.0.1"
- TESTS_ZEND_CACHE_MEMCACHED_PORT=11211
- TESTS_ZEND_CACHE_MEMCACHE_ENABLED=true
- TESTS_ZEND_CACHE_MEMCACHE_HOST=$TESTS_ZEND_CACHE_MEMCACHED_HOST
- TESTS_ZEND_CACHE_MEMCACHE_PORT=$TESTS_ZEND_CACHE_MEMCACHED_PORT
- TESTS_ZEND_CACHE_MONGODB_ENABLED=true
- TESTS_ZEND_CACHE_REDIS_ENABLED=true
- TESTS_ZEND_CACHE_REDIS_HOST="127.0.0.1"
- TESTS_ZEND_CACHE_REDIS_PORT=6379
- TESTS_ZEND_CACHE_REDIS_PASSWORD=""
- TESTS_ZEND_CACHE_REDIS_DATABASE=0
- TESTS_ZEND_CACHE_XCACHE_ENABLED=true
- TESTS_ZEND_CACHE_XCACHE_ADMIN_AUTH=true
- TESTS_ZEND_CACHE_XCACHE_ADMIN_USER=travis
- TESTS_ZEND_CACHE_XCACHE_ADMIN_PASS=test
- SITE_URL: https://zendframework.github.io/zend-cache
- GH_USER_NAME: "Matthew Weier O'Phinney"
- GH_USER_EMAIL: matthew@weierophinney.net
- GH_REF: github.com/zendframework/zend-cache.git
- APCU_PECL_VERSION="apcu"
- SITE_URL="https://zendframework.github.io/zend-cache"
- GH_USER_NAME="Matthew Weier O'Phinney"
- GH_USER_EMAIL="matthew@weierophinney.net"
- GH_REF="github.com/zendframework/zend-cache.git"
- secure: "ZYYlfFWTde5MCn6twsm/+s+mx4bLEaVFFG+tuaeiz7nCx+z495D6FxruzBbY1zheX9rNo9qReDo0Tyfn2wrUH8SJYbR9iKDqB95GPDDPW+I23Mw3Uuddr8XqbtabTJVqEQg6iAu7IIQG4TvFFmdq/g26jWim8Cngg/5zZh4Q2GuLSjIKRJBpLe7mSTjQVqaApS/a8wmvPJiSoqxWmY8Botc88ZXMmkRDPQoqEdZOeS4i029cGMXUnzGj7Vl7qwfol6Yj/R441Hd84Vt8P8BOdRyW0tjmllXLXJUYFKCcP5fEqIujbU68FwJMidCPzBcXv2N0klW43ViVwdJD6gBgZStwOyENGeEw1VcbZ6JReMa68F1mtqLhBhZtF8WRUI8+TYMYmLPGMVTcets4P3nIB18uX1CittwGDD2y2OL8MDvuIuaSQFoj/PdUb+BC/DvvmtPGnF6MLTAUjqNlxYbmzopufDEtivWHsqeyxHZj0L0HD5KkMslD9wnngfi+lcQ5e3iFQe/H5vQKE0BfooukxErIXk00cwwMoMjFY4v95CS0BKFhA4HMclKpGEA94CH4STxwyD2Nz/z6iGPqkZuzqDLOKhLr2FsY7bFbvEdNu57G3PGahtYJtc31lcnwKf2t1ALGcG9LS0/ezJSzqx659hWL0B5qgHjCNDnAyKJcNxM="

matrix:
fast_finish: true
include:
- php: 5.5
env:
- EXECUTE_CS_CHECK=true
- PECL_INSTALL_APCU='apcu-4.0.8'
- INSTALL_XCACHE=true
- php: 5.5
- php: 5.6
env:
- SERVICE_MANAGER_VERSION="^2.7.5"
- EVENT_MANAGER_VERSION="^2.6.2"
- PECL_INSTALL_APCU='apcu-4.0.8'
- INSTALL_XCACHE=true
- DEPS=lowest
- APCU_PECL_VERSION="apcu-4.0.11"
- php: 5.6
env:
- EXECUTE_TEST_COVERALLS=true
- PECL_INSTALL_APCU='apcu-4.0.8'
- INSTALL_XCACHE=true
- DEPS=locked
- TEST_COVERAGE=true
- APCU_PECL_VERSION="apcu-4.0.11"
- DEPLOY_DOCS="$(if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then echo -n 'true' ; else echo -n 'false' ; fi)"
- PATH="$HOME/.local/bin:$PATH"
- php: 5.6
env:
- SERVICE_MANAGER_VERSION="^2.7.5"
- EVENT_MANAGER_VERSION="^2.6.2"
- PECL_INSTALL_APCU='apcu-4.0.8'
- INSTALL_XCACHE=true
- DEPS=latest
- APCU_PECL_VERSION="apcu-4.0.11"
- php: 7
env:
- DEPS=lowest
- INSTALL_APCU_BC=true

# TODO:
# re-enable these extentions as soon as they are available and stable on php 7
- TESTS_ZEND_CACHE_MEMCACHE_ENABLED=false
- TESTS_ZEND_CACHE_MEMCACHED_ENABLED=false
- TESTS_ZEND_CACHE_MONGODB_ENABLED=false
- TESTS_ZEND_CACHE_XCACHE_ENABLED=false
- php: 7
env:
- EXECUTE_TEST_COVERALLS=true
- PECL_INSTALL_APCU='apcu'
- PECL_INSTALL_APCU_BC='apcu_bc-beta'
- DEPS=locked
- CHECK_CS=true
- INSTALL_APCU_BC=true

# FIXME:
# there is no memcached extension available for PHP-7
# the version provided by travis is not yet ready and buggy
# TODO:
# re-enable these extentions as soon as they are available and stable on php 7
- TESTS_ZEND_CACHE_MEMCACHE_ENABLED=false
- TESTS_ZEND_CACHE_MEMCACHED_ENABLED=false
- TESTS_ZEND_CACHE_MONGODB_ENABLED=false
- TESTS_ZEND_CACHE_XCACHE_ENABLED=false
- php: 7
env:
- SERVICE_MANAGER_VERSION="^2.7.5"
- EVENT_MANAGER_VERSION="^2.6.2"
- PECL_INSTALL_APCU='apcu'
- PECL_INSTALL_APCU_BC='apcu_bc-beta'

# FIXME:
# there is no memcached extension available for PHP-7
# the version provided by travis is not yet ready and buggy
- DEPS=latest
- INSTALL_APCU_BC=true

# TODO:
# re-enable these extentions as soon as they are available and stable on php 7
- TESTS_ZEND_CACHE_MEMCACHE_ENABLED=false
- TESTS_ZEND_CACHE_MEMCACHED_ENABLED=false
- TESTS_ZEND_CACHE_MONGODB_ENABLED=false
- TESTS_ZEND_CACHE_XCACHE_ENABLED=false
- php: hhvm
env:
- DEPS=lowest
- TESTS_ZEND_CACHE_XCACHE_ENABLED=false
- TESTS_ZEND_CACHE_APCU_ENABLED=false
- php: hhvm
env:
- DEPS=locked
- TESTS_ZEND_CACHE_XCACHE_ENABLED=false
- TESTS_ZEND_CACHE_APCU_ENABLED=false
- php: hhvm
env:
- SERVICE_MANAGER_VERSION="^2.7.5"
- EVENT_MANAGER_VERSION="^2.6.2"
- DEPS=latest
- TESTS_ZEND_CACHE_XCACHE_ENABLED=false
- TESTS_ZEND_CACHE_APCU_ENABLED=false
allow_failures:
- php: hhvm

Expand All @@ -106,44 +121,72 @@ notifications:
email: false

before_install:
- pwd=$(pwd) ;
- composer self-update
- if [[ $EXECUTE_TEST_COVERALLS != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi
- if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then composer require --dev --no-update satooshi/php-coveralls ; fi
- if [[ $SERVICE_MANAGER_VERSION != '' ]]; then composer require --no-update "zendframework/zend-servicemanager:$SERVICE_MANAGER_VERSION" ; fi
- if [[ $SERVICE_MANAGER_VERSION == '' ]]; then composer require --no-update "zendframework/zend-servicemanager:^3.0.3" ; fi
- if [[ $EVENT_MANAGER_VERSION != '' ]]; then composer require --no-update "zendframework/zend-eventmanager:$EVENT_MANAGER_VERSION" ; fi
- if [[ $EVENT_MANAGER_VERSION == '' ]]; then composer require --no-update "zendframework/zend-eventmanager:^3.0" ; fi
- travis_retry composer self-update
- if [[ $TRAVIS_PHP_VERSION != "hhvm" && $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini ; fi

install:
- travis_retry composer install --no-interaction --ignore-platform-reqs
- if [[ $INSTALL_XCACHE == 'true' ]]; then
git clone https://github.com/lighttpd/xcache.git && cd xcache
&& git checkout $(git rev-list --tags --max-count=1)
&& phpize && ./configure --enable-xcache && make install
&& phpenv config-add $pwd/.ci/xcache.ini
|| return 0 ;
cd $pwd ;
# prevent PECL from enabling the extension by default, see https://pear.php.net/bugs/bug.php?id=21007
- if [[ $TESTS_ZEND_CACHE_APCU_ENABLED == 'true' ]]; then
echo "yes\nno\n" | pecl install $APCU_PECL_VERSION
&& sed -i 's/extension="apcu.so"//' ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini ;
fi
- if [[ $PECL_INSTALL_APCU != '' ]]; then echo "yes\nno\n" | pecl install $PECL_INSTALL_APCU || return 0 ; fi

# see https://pear.php.net/bugs/bug.php?id=21007
# pecl install adds the "extension=*.so" directive on top of php.ini which results in wrong extension order
# -> Attach another ini file loading the extension kind of solves the issue.
# The first extension loading still results in a warning but it doesn't break the test
- if [[ $PECL_INSTALL_APCU_BC != '' ]]; then pecl install $PECL_INSTALL_APCU_BC && phpenv config-add .ci/apcu_bc.ini || return 0 ; fi
- if [[ $INSTALL_APCU_BC == 'true' ]]; then
git clone https://github.com/krakjoe/apcu-bc.git
&& (
cd apcu-bc
&& git checkout $(git rev-list --tags --max-count=1)
&& phpize && ./configure && make && make install
);
fi

- if [[ $TESTS_ZEND_CACHE_XCACHE_ENABLED == 'true' ]]; then
git clone https://github.com/lighttpd/xcache.git
&& (
cd xcache
&& git checkout $(git rev-list --tags --max-count=1)
&& phpize && ./configure --enable-xcache && make install
);
fi

- if [[ $DEPS == 'latest' ]]; then travis_retry composer update $COMPOSER_ARGS ; fi
- if [[ $DEPS == 'lowest' ]]; then travis_retry composer update --prefer-lowest --prefer-stable $COMPOSER_ARGS ; fi
- if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry composer require --dev $COMPOSER_ARGS satooshi/php-coveralls:^1.0 ; fi
- travis_retry composer install $COMPOSER_ARGS
- composer show

before_script:
- phpenv config-add .ci/php.ini || return 0
- if [[ $TRAVIS_PHP_VERSION != 'hhvm' ]]; then
if [[ $TESTS_ZEND_CACHE_APCU_ENABLED == 'true' && ! $INSTALL_APCU_BC ]]; then
phpenv config-add .ci/apcu.ini ;
fi ;
if [[ $INSTALL_APCU_BC == 'true' ]]; then
phpenv config-add .ci/apcu_bc.ini ;
fi ;
if [[ $TESTS_ZEND_CACHE_REDIS_ENABLED == 'true' ]]; then
phpenv config-add .ci/redis.ini ;
fi ;
if [[ $TESTS_ZEND_CACHE_MEMCACHE_ENABLED == 'true' ]]; then
phpenv config-add .ci/memcache.ini ;
fi ;
if [[ $TESTS_ZEND_CACHE_MEMCACHED_ENABLED == 'true' ]]; then
phpenv config-add .ci/memcached.ini ;
fi ;
if [[ $TESTS_ZEND_CACHE_MONGODB_ENABLED == 'true' ]]; then
phpenv config-add .ci/mongo.ini ;
fi ;
if [[ $TESTS_ZEND_CACHE_XCACHE_ENABLED == 'true' ]]; then
phpenv config-add .ci/xcache.ini ;
fi ;
fi

script:
- if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then ./vendor/bin/phpunit --coverage-clover clover.xml ; fi
- if [[ $EXECUTE_TEST_COVERALLS != 'true' ]]; then ./vendor/bin/phpunit ; fi
- if [[ $EXECUTE_CS_CHECK == 'true' ]]; then ./vendor/bin/php-cs-fixer fix -v --diff --dry-run ; fi
- if [[ $DEPLOY_DOCS == "true" && "$TRAVIS_TEST_RESULT" == "0" ]]; then wget -O theme-installer.sh "https://raw.githubusercontent.com/zendframework/zf-mkdoc-theme/master/theme-installer.sh" ; chmod 755 theme-installer.sh ; ./theme-installer.sh ; fi

after_success:
- if [[ $DEPLOY_DOCS == "true" ]]; then echo "Preparing to build and deploy documentation" ; ./zf-mkdoc-theme/deploy.sh ; echo "Completed deploying documentation" ; fi
- if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage -- --verbose ; else composer test -- --verbose ; fi
- if [[ $CHECK_CS == 'true' ]]; then composer cs-check ; fi
- if [[ $DEPLOY_DOCS == "true" && "$TRAVIS_TEST_RESULT" == "0" ]]; then travis_retry curl -sSL https://raw.githubusercontent.com/zendframework/zf-mkdoc-theme/master/theme-installer.sh | bash ; fi

after_script:
- if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then travis_retry ./vendor/bin/coveralls ; fi
- if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry composer upload-coverage ; fi

after_success:
- if [[ $DEPLOY_DOCS == "true" ]]; then ./zf-mkdoc-theme/deploy.sh ; fi
15 changes: 13 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
}
},
"require": {
"php": "^5.5 || ^7.0",
"php": "^5.6 || ^7.0",
"zendframework/zend-stdlib": "^2.7 || ^3.0",
"zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3",
"zendframework/zend-eventmanager": "^2.6.2 || ^3.0"
Expand All @@ -22,7 +22,7 @@
"zendframework/zend-serializer": "^2.6",
"zendframework/zend-session": "^2.6.2",
"fabpot/php-cs-fixer": "1.7.*",
"phpunit/phpunit": "^4.5",
"phpunit/phpunit": "^4.8",
"phpbench/phpbench": "^0.10.0"
},
"suggest": {
Expand Down Expand Up @@ -56,5 +56,16 @@
"ZendTest\\Cache\\": "test/",
"ZendBench\\Cache\\": "benchmark/"
}
},
"scripts": {
"check": [
"@cs-check",
"@test"
],
"upload-coverage": "coveralls -v",
"cs-check": "php-cs-fixer --version && php-cs-fixer fix -v --diff --dry-run",
"cs-fix": "php-cs-fixer fix -v",
"test": "phpunit --colors=always",
"test-coverage": "phpunit --colors=always --coverage-clover clover.xml"
}
}
Loading

0 comments on commit 4b8a6fc

Please sign in to comment.