From a46c7ee3367722559ff61b06c300bd0e3f352298 Mon Sep 17 00:00:00 2001 From: Tomislav Muic Date: Wed, 15 Nov 2017 12:42:54 -0800 Subject: [PATCH 1/3] Do not crash on status tab if opcache disabled --- opcache.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/opcache.php b/opcache.php index 22b4b2f..739e367 100644 --- a/opcache.php +++ b/opcache.php @@ -27,6 +27,11 @@ public function getPageTitle() public function getStatusDataRows() { $rows = array(); + + if (empty($this->_status)) { + return "
Opcache disabled"; + } + foreach ($this->_status as $key => $value) { if ($key === 'scripts') { continue; From eb3466e54be978552c96936ea7f50e0579168e44 Mon Sep 17 00:00:00 2001 From: Tomislav Muic Date: Wed, 15 Nov 2017 12:45:04 -0800 Subject: [PATCH 2/3] Do not crash on scripts tab if opcache disabled --- opcache.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/opcache.php b/opcache.php index 739e367..a423334 100644 --- a/opcache.php +++ b/opcache.php @@ -103,6 +103,11 @@ public function getConfigDataRows() public function getScriptStatusRows() { + + if (empty($this->_status)) { + return "
Opcache disabled"; + } + foreach ($this->_status['scripts'] as $key => $data) { $dirs[dirname($key)][basename($key)] = $data; $this->_arrayPset($this->_d3Scripts, $key, array( From ae321091c840d8cd7672e65aadbbc41e459116c6 Mon Sep 17 00:00:00 2001 From: Tomislav Muic Date: Wed, 15 Nov 2017 12:55:53 -0800 Subject: [PATCH 3/3] Return N/A as script count when opcache is disabled --- opcache.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/opcache.php b/opcache.php index a423334..12afbbf 100644 --- a/opcache.php +++ b/opcache.php @@ -28,7 +28,7 @@ public function getStatusDataRows() { $rows = array(); - if (empty($this->_status)) { + if ($this->_status === false) { return "
Opcache disabled"; } @@ -104,7 +104,7 @@ public function getConfigDataRows() public function getScriptStatusRows() { - if (empty($this->_status)) { + if ($this->_status === false) { return "
Opcache disabled"; } @@ -160,6 +160,10 @@ public function getScriptStatusRows() public function getScriptStatusCount() { + if ($this->_status === false) { + return "N/A"; + } + return count($this->_status["scripts"]); }