Changeset View
Changeset View
Standalone View
Standalone View
src/applications/cache/spec/PhabricatorOpcodeCacheSpec.php
| Show All 17 Lines | final class PhabricatorOpcodeCacheSpec extends PhabricatorCacheSpec { | ||||
| } | } | ||||
| private function initAPCSpec() { | private function initAPCSpec() { | ||||
| $this | $this | ||||
| ->setName(pht('APC')) | ->setName(pht('APC')) | ||||
| ->setVersion(phpversion('apc')); | ->setVersion(phpversion('apc')); | ||||
| if (ini_get('apc.enabled')) { | if (ini_get('apc.enabled')) { | ||||
| $this->setIsEnabled(true); | $this | ||||
| ->setIsEnabled(true) | |||||
| ->setClearCacheCallback('apc_clear_cache'); | |||||
| $mem = apc_sma_info(); | $mem = apc_sma_info(); | ||||
| $this->setTotalMemory($mem['num_seg'] * $mem['seg_size']); | $this->setTotalMemory($mem['num_seg'] * $mem['seg_size']); | ||||
| $info = apc_cache_info(); | $info = apc_cache_info(); | ||||
| $this->setUsedMemory($info['mem_size']); | $this->setUsedMemory($info['mem_size']); | ||||
| $write_lock = ini_get('apc.write_lock'); | $write_lock = ini_get('apc.write_lock'); | ||||
| ▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | final class PhabricatorOpcodeCacheSpec extends PhabricatorCacheSpec { | ||||
| } | } | ||||
| private function initOpcacheSpec() { | private function initOpcacheSpec() { | ||||
| $this | $this | ||||
| ->setName(pht('Zend OPcache')) | ->setName(pht('Zend OPcache')) | ||||
| ->setVersion(phpversion('Zend OPcache')); | ->setVersion(phpversion('Zend OPcache')); | ||||
| if (ini_get('opcache.enable')) { | if (ini_get('opcache.enable')) { | ||||
| $this->setIsEnabled(true); | $this | ||||
| ->setIsEnabled(true) | |||||
| ->setClearCacheCallback('opcache_reset'); | |||||
| $status = opcache_get_status(); | $status = opcache_get_status(); | ||||
| $memory = $status['memory_usage']; | $memory = $status['memory_usage']; | ||||
| $mem_used = $memory['used_memory']; | $mem_used = $memory['used_memory']; | ||||
| $mem_free = $memory['free_memory']; | $mem_free = $memory['free_memory']; | ||||
| $mem_junk = $memory['wasted_memory']; | $mem_junk = $memory['wasted_memory']; | ||||
| $this->setUsedMemory($mem_used + $mem_junk); | $this->setUsedMemory($mem_used + $mem_junk); | ||||
| ▲ Show 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | if (version_compare(phpversion(), '5.5', '>=')) { | ||||
| ->setShortName(pht('OPcache')) | ->setShortName(pht('OPcache')) | ||||
| ->setName(pht('Zend OPcache Not Installed')) | ->setName(pht('Zend OPcache Not Installed')) | ||||
| ->setMessage($message) | ->setMessage($message) | ||||
| ->addPHPExtension('Zend OPcache'); | ->addPHPExtension('Zend OPcache'); | ||||
| } else { | } else { | ||||
| $this->raiseInstallAPCIssue(); | $this->raiseInstallAPCIssue(); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||