diff --git a/.travis.yml b/.travis.yml index 5a8f883..183ef6d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,6 +16,7 @@ env: global: - COMPOSER_ARGS="--no-interaction" - COVERAGE_DEPS="php-coveralls/php-coveralls" + - TESTS_ZEND_DIAGNOSTICS_APCU_ENABLED=true - TESTS_ZEND_DIAGNOSTICS_MONGO_ENABLED=true - TESTS_ZEND_DIAGNOSTICS_RABBITMQ_ENABLED=true - TESTS_ZEND_DIAGNOSTICS_REDIS_ENABLED=true @@ -26,6 +27,7 @@ matrix: env: - DEPS=lowest - MONGO_LEGACY=true + - TESTS_ZEND_DIAGNOSTICS_APCU_ENABLED=false - TESTS_ZEND_DIAGNOSTICS_MEMCACHE_ENABLED=true - TESTS_ZEND_DIAGNOSTICS_MEMCACHED_ENABLED=false - php: 5.6 @@ -33,12 +35,14 @@ matrix: - DEPS=locked - MONGO_LEGACY=true - LEGACY_DEPS="phpunit/phpunit" + - TESTS_ZEND_DIAGNOSTICS_APCU_ENABLED=false - TESTS_ZEND_DIAGNOSTICS_MEMCACHE_ENABLED=true - TESTS_ZEND_DIAGNOSTICS_MEMCACHED_ENABLED=false - php: 5.6 env: - DEPS=latest - MONGO_LEGACY=true + - TESTS_ZEND_DIAGNOSTICS_APCU_ENABLED=false - TESTS_ZEND_DIAGNOSTICS_MEMCACHE_ENABLED=true - TESTS_ZEND_DIAGNOSTICS_MEMCACHED_ENABLED=false - php: 7 @@ -83,6 +87,7 @@ matrix: before_install: - if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi + - if [[ $TESTS_ZEND_DIAGNOSTICS_APCU_ENABLED == 'true' ]]; then echo "extension = apcu.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini ; fi - if [[ $TESTS_ZEND_DIAGNOSTICS_MEMCACHE_ENABLED == 'true' ]]; then echo "extension = memcache.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini ; fi - if [[ $TESTS_ZEND_DIAGNOSTICS_MEMCACHED_ENABLED == 'true' ]]; then echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini ; fi - if [[ $MONGO_LEGACY == 'true' ]]; then echo "extension = mongo.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini ; fi diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c2bd3f..fb454c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,28 @@ All notable changes to this project will be documented in this file, in reverse Releases prior to 1.2.0 did not have entries. +## 1.3.0 - 2018-07-30 + +### Added + +- [#93](https://github.com/zendframework/zenddiagnostics/pull/93) adds compatibility for apcu + +### Changed + +- Nothing. + +### Deprecated + +- Nothing. + +### Removed + +- Nothing. + +### Fixed + +- Nothing. + ## 1.2.0 - 2018-06-25 ### Added diff --git a/composer.json b/composer.json index 2b55e1c..2de186a 100644 --- a/composer.json +++ b/composer.json @@ -56,7 +56,8 @@ }, "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.3.x-dev", + "dev-develop": "1.4.x-dev" } }, "scripts": { diff --git a/composer.lock b/composer.lock index 4e5c36b..5dd7e46 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c225d9018bb6044c0423897bd18d9d5c", + "content-hash": "74b623d370b9548ee90cb01e769f279f", "packages": [], "packages-dev": [ { diff --git a/src/Check/ApcFragmentation.php b/src/Check/ApcFragmentation.php index 8f21245..6d17378 100644 --- a/src/Check/ApcFragmentation.php +++ b/src/Check/ApcFragmentation.php @@ -14,9 +14,9 @@ use ZendDiagnostics\Result\Warning; /** - * Checks to see if the APC fragmentation is below warning/critical thresholds + * Checks to see if the APCu fragmentation is below warning/critical thresholds * - * APC memory logic borrowed from APC project: + * APCu memory logic borrowed from APC project: * * https://github.com/php/pecl-caching-apc/blob/master/apc.php * authors: Ralf Becker , Rasmus Lerdorf , Ilia Alshanetsky @@ -90,11 +90,11 @@ public function check() return new Skip('APC has not been enabled in CLI.'); } - if (! function_exists('apc_sma_info')) { - return new Warning('APC extension is not available'); + if (! function_exists('apcu_sma_info')) { + return new Warning('APCu extension is not available'); } - if (! $info = apc_sma_info()) { + if (! $info = apcu_sma_info()) { return new Warning('Unable to retrieve APC memory status information.'); } diff --git a/src/Check/ApcMemory.php b/src/Check/ApcMemory.php index dbd4ba1..e4e2c4c 100644 --- a/src/Check/ApcMemory.php +++ b/src/Check/ApcMemory.php @@ -13,9 +13,9 @@ use ZendDiagnostics\Result\Warning; /** - * Checks to see if the APC memory usage is below warning/critical thresholds + * Checks to see if the APCu memory usage is below warning/critical thresholds * - * APC memory logic borrowed from APC project: + * APCu memory logic borrowed from APC project: * https://github.com/php/pecl-caching-apc/blob/master/apc.php * authors: Ralf Becker , Rasmus Lerdorf , Ilia Alshanetsky * license: The PHP License, version 3.01 @@ -46,11 +46,14 @@ public function check() return new Skip('APC has not been enabled in CLI.'); } - if (! function_exists('apc_sma_info')) { - return new Warning('APC extension is not available'); + if (! function_exists('apcu_sma_info')) { + return new Warning(sprintf( + '%s extension is not available', + PHP_VERSION_ID < 70000 ? 'APC' : 'APCu' + )); } - if (! $this->apcInfo = apc_sma_info()) { + if (! $this->apcInfo = apcu_sma_info()) { return new Warning('Unable to retrieve APC memory status information.'); }