From f8882294985864bcbd162eb0f2baa1ea40a792f4 Mon Sep 17 00:00:00 2001 From: Martin Parsiegla Date: Fri, 27 Jul 2018 11:19:19 +0200 Subject: [PATCH 1/5] Use apcu instead of apc for PHP >= 7 --- src/Check/ApcFragmentation.php | 5 +++-- src/Check/ApcMemory.php | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Check/ApcFragmentation.php b/src/Check/ApcFragmentation.php index 8f21245..699288b 100644 --- a/src/Check/ApcFragmentation.php +++ b/src/Check/ApcFragmentation.php @@ -90,11 +90,12 @@ public function check() return new Skip('APC has not been enabled in CLI.'); } - if (! function_exists('apc_sma_info')) { + $memoryAllocationMethod = \PHP_VERSION_ID < 70000 ? 'apc_sma_info' : 'apcu_sma_info'; + if (! function_exists($memoryAllocationMethod)) { return new Warning('APC extension is not available'); } - if (! $info = apc_sma_info()) { + if (! $info = $memoryAllocationMethod()) { return new Warning('Unable to retrieve APC memory status information.'); } diff --git a/src/Check/ApcMemory.php b/src/Check/ApcMemory.php index dbd4ba1..ea9b0b4 100644 --- a/src/Check/ApcMemory.php +++ b/src/Check/ApcMemory.php @@ -46,11 +46,12 @@ public function check() return new Skip('APC has not been enabled in CLI.'); } - if (! function_exists('apc_sma_info')) { + $memoryAllocationMethod = \PHP_VERSION_ID < 70000 ? 'apc_sma_info' : 'apcu_sma_info'; + if (! function_exists($memoryAllocationMethod)) { return new Warning('APC extension is not available'); } - if (! $this->apcInfo = apc_sma_info()) { + if (! $this->apcInfo = $memoryAllocationMethod()) { return new Warning('Unable to retrieve APC memory status information.'); } From a57ebf9f0c0f2f63a273e0b9176675bf533ea653 Mon Sep 17 00:00:00 2001 From: Martin Parsiegla Date: Fri, 27 Jul 2018 11:39:03 +0200 Subject: [PATCH 2/5] Add changelog entry for apcu compatibility --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c2bd3f..58013be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ 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.2.1 - TBD + +- [#93](https://github.com/zendframework/zenddiagnostics/pull/93) adds compatibility for apcu + ## 1.2.0 - 2018-06-25 ### Added From f42cd8611763d8020c3997ac5d5340851c2d481f Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Mon, 30 Jul 2018 14:51:33 -0500 Subject: [PATCH 3/5] Adds CHANGELOG stub for 1.3.0 --- CHANGELOG.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c2bd3f..96eb777 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 - TBD + +### Added + +- Nothing. + +### Changed + +- Nothing. + +### Deprecated + +- Nothing. + +### Removed + +- Nothing. + +### Fixed + +- Nothing. + ## 1.2.0 - 2018-06-25 ### Added From 8f048ff1733821463d9eb9dc1a569303bd3ea98b Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Mon, 30 Jul 2018 15:30:04 -0500 Subject: [PATCH 4/5] Update branch aliases - dev-master => 1.3.x-dev - dev-develop => 1.4.x-dev --- composer.json | 3 ++- composer.lock | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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": [ { From 2c718f20c598a549daf50add957bf492b0c3f5fa Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Mon, 30 Jul 2018 15:29:03 -0500 Subject: [PATCH 5/5] Prepares for 1.3.0 release - Sets date in CHANGELOG - Removes empty 1.2.1 stub in CHANGELOG --- CHANGELOG.md | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e216cb0..fb454c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ 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 - TBD +## 1.3.0 - 2018-07-30 ### Added @@ -26,28 +26,6 @@ Releases prior to 1.2.0 did not have entries. - Nothing. -## 1.2.1 - TBD - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - ## 1.2.0 - 2018-06-25 ### Added