Exemplo n.º 1
0
 /**
  * Perform the check
  *
  * @see \ZendDiagnostics\Check\CheckInterface::check()     *
  * @return Failure|Skip|Success|Warning
  */
 public function check()
 {
     if (!function_exists('opcache_get_status')) {
         return new Warning('Zend OPcache extension is not available');
     }
     $this->opCacheInfo = opcache_get_status(false);
     if (!is_array($this->opCacheInfo) || !array_key_exists('memory_usage', $this->opCacheInfo)) {
         return new Warning('Zend OPcache extension is not enabled in this environment');
     }
     return parent::check();
 }
Exemplo n.º 2
0
 /**
  * Perform the check
  *
  * @see \ZendDiagnostics\Check\CheckInterface::check()     *
  * @return Failure|Skip|Success|Warning
  */
 public function check()
 {
     if (!ini_get('apc.enabled')) {
         return new Skip('APC has not been enabled or installed.');
     }
     if (php_sapi_name() == 'cli' && !ini_get('apc.enabled_cli')) {
         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 (!($this->apcInfo = apc_sma_info())) {
         return new Warning('Unable to retrieve APC memory status information.');
     }
     return parent::check();
 }