Add support for detection of Zend OPcache as an accelerator
This commit is contained in:
parent
46efc9b4ac
commit
8e9cb3b0a7
@ -171,6 +171,10 @@
|
|||||||
<th>APC</th>
|
<th>APC</th>
|
||||||
<td>{{ collector.hasapc ? 'enabled' : 'disabled' }}</td>
|
<td>{{ collector.hasapc ? 'enabled' : 'disabled' }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Zend OPcache</th>
|
||||||
|
<td>{{ collector.haszendopcache ? 'enabled' : 'disabled' }}</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>EAccelerator</th>
|
<th>EAccelerator</th>
|
||||||
<td>{{ collector.haseaccelerator ? 'enabled' : 'disabled' }}</td>
|
<td>{{ collector.haseaccelerator ? 'enabled' : 'disabled' }}</td>
|
||||||
|
@ -69,6 +69,7 @@ class ConfigDataCollector extends DataCollector
|
|||||||
'apc_enabled' => extension_loaded('apc') && ini_get('apc.enabled'),
|
'apc_enabled' => extension_loaded('apc') && ini_get('apc.enabled'),
|
||||||
'xcache_enabled' => extension_loaded('xcache') && ini_get('xcache.cacher'),
|
'xcache_enabled' => extension_loaded('xcache') && ini_get('xcache.cacher'),
|
||||||
'wincache_enabled' => extension_loaded('wincache') && ini_get('wincache.ocenabled'),
|
'wincache_enabled' => extension_loaded('wincache') && ini_get('wincache.ocenabled'),
|
||||||
|
'zend_opcache_enabled' => extension_loaded('Zend OPcache') && ini_get('opcache.enable'),
|
||||||
'bundles' => array(),
|
'bundles' => array(),
|
||||||
'sapi_name' => php_sapi_name()
|
'sapi_name' => php_sapi_name()
|
||||||
);
|
);
|
||||||
@ -180,6 +181,16 @@ class ConfigDataCollector extends DataCollector
|
|||||||
return $this->data['apc_enabled'];
|
return $this->data['apc_enabled'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if Zend OPcache is enabled
|
||||||
|
*
|
||||||
|
* @return Boolean true if Zend OPcache is enabled, false otherwise
|
||||||
|
*/
|
||||||
|
public function hasZendOpcache()
|
||||||
|
{
|
||||||
|
return $this->data['zend_opcache_enabled'];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if XCache is enabled.
|
* Returns true if XCache is enabled.
|
||||||
*
|
*
|
||||||
@ -207,7 +218,7 @@ class ConfigDataCollector extends DataCollector
|
|||||||
*/
|
*/
|
||||||
public function hasAccelerator()
|
public function hasAccelerator()
|
||||||
{
|
{
|
||||||
return $this->hasApc() || $this->hasEAccelerator() || $this->hasXCache() || $this->hasWinCache();
|
return $this->hasApc() || $this->hasZendOpcache() || $this->hasEAccelerator() || $this->hasXCache() || $this->hasWinCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBundles()
|
public function getBundles()
|
||||||
|
@ -53,6 +53,8 @@ class ConfigDataCollectorTest extends \PHPUnit_Framework_TestCase
|
|||||||
||
|
||
|
||||||
(extension_loaded('apc') && ini_get('apc.enabled'))
|
(extension_loaded('apc') && ini_get('apc.enabled'))
|
||||||
||
|
||
|
||||||
|
(extension_loaded('Zend OPcache') && ini_get('opcache.enable'))
|
||||||
|
||
|
||||||
(extension_loaded('xcache') && ini_get('xcache.cacher'))
|
(extension_loaded('xcache') && ini_get('xcache.cacher'))
|
||||||
||
|
||
|
||||||
(extension_loaded('wincache') && ini_get('wincache.ocenabled')))) {
|
(extension_loaded('wincache') && ini_get('wincache.ocenabled')))) {
|
||||||
|
Reference in New Issue
Block a user