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

Commit 048ab44

Browse files
committed
skip apc checks in CLI
1 parent 23998e7 commit 048ab44

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/ZendDiagnostics/Check/ApcFragmentation.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ public function __construct($warningThreshold, $criticalThreshold)
7272
*/
7373
public function check()
7474
{
75+
if (!ini_get('apc.enabled')) {
76+
return new Skip('APC has not been enabled or installed.');
77+
}
78+
79+
if (php_sapi_name() == 'cli' && !ini_get('apc.enabled_cli')) {
80+
return new Skip('APC has not been enabled in CLI.');
81+
}
82+
7583
if (!function_exists('apc_sma_info')) {
7684
return new Warning('APC extension is not available');
7785
}

src/ZendDiagnostics/Check/ApcMemory.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ public function __construct($warningThreshold, $criticalThreshold)
7171
*/
7272
public function check()
7373
{
74+
if (!ini_get('apc.enabled')) {
75+
return new Skip('APC has not been enabled or installed.');
76+
}
77+
78+
if (php_sapi_name() == 'cli' && !ini_get('apc.enabled_cli')) {
79+
return new Skip('APC has not been enabled in CLI.');
80+
}
81+
7482
if (!function_exists('apc_sma_info')) {
7583
return new Warning('APC extension is not available');
7684
}

0 commit comments

Comments
 (0)