From ec2e147c131097507f91f47491ec22c1dc4ebb15 Mon Sep 17 00:00:00 2001 From: Mohammad Eftekhari Date: Sun, 13 Dec 2020 12:55:52 +0330 Subject: [PATCH 1/2] Add $get_scripts parameter to OpcacheClass::getStatus() method Sometimes I need to know about the scripts loaded via the opcache and see their cache hit times but there was no way to do this with the package methods itself and I think this doesn't break anything, so no harm to have it. Thanks --- src/OpcacheClass.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/OpcacheClass.php b/src/OpcacheClass.php index 337363b..3db6b3d 100755 --- a/src/OpcacheClass.php +++ b/src/OpcacheClass.php @@ -32,10 +32,10 @@ public function getConfig() /** * Get status info. */ - public function getStatus() + public function getStatus($get_scripts=false) { if (function_exists('opcache_get_status')) { - return opcache_get_status(false); + return opcache_get_status($get_scripts); } } From d1380d402b7873a094dcf639c47369748683e1f9 Mon Sep 17 00:00:00 2001 From: Mohammad Eftekhari Date: Sun, 13 Dec 2020 12:58:47 +0330 Subject: [PATCH 2/2] Fix style: use spaces for arguments of methods --- src/OpcacheClass.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpcacheClass.php b/src/OpcacheClass.php index 3db6b3d..2d2bb31 100755 --- a/src/OpcacheClass.php +++ b/src/OpcacheClass.php @@ -32,7 +32,7 @@ public function getConfig() /** * Get status info. */ - public function getStatus($get_scripts=false) + public function getStatus($get_scripts = false) { if (function_exists('opcache_get_status')) { return opcache_get_status($get_scripts);