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

Commit

Permalink
Merging develop to master in preparation for 1.3.0 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
weierophinney committed Jul 30, 2018
2 parents bb03241 + 2d2b769 commit 6dd4a15
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -26,19 +27,22 @@ 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
env:
- 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
Expand Down Expand Up @@ -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
Expand Down
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions src/Check/ApcFragmentation.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <beckerr@php.net>, Rasmus Lerdorf <rasmus@php.net>, Ilia Alshanetsky <ilia@prohost.org>
Expand Down Expand Up @@ -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.');
}

Expand Down
13 changes: 8 additions & 5 deletions src/Check/ApcMemory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <beckerr@php.net>, Rasmus Lerdorf <rasmus@php.net>, Ilia Alshanetsky <ilia@prohost.org>
* license: The PHP License, version 3.01
Expand Down Expand Up @@ -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.');
}

Expand Down

0 comments on commit 6dd4a15

Please sign in to comment.