本文整理汇总了PHP中accelerator_reset函数的典型用法代码示例。如果您正苦于以下问题:PHP accelerator_reset函数的具体用法?PHP accelerator_reset怎么用?PHP accelerator_reset使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了accelerator_reset函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cleanOpcodes
/**
* Try to reset any opcode caches we know about
*
* @todo make it so developers can extend this somehow
*/
public static function cleanOpcodes()
{
// APC
if (function_exists('apc_clear_cache') && ini_get('apc.stat') == 0) {
apc_clear_cache();
}
// Wincache
if (function_exists('wincache_refresh_if_changed')) {
wincache_refresh_if_changed();
}
// Zend
if (function_exists('accelerator_reset')) {
accelerator_reset();
}
// eAccelerator
if (function_exists('eaccelerator_clear')) {
eaccelerator_clear();
}
// XCache
if (function_exists('xcache_clear_cache') && !ini_get('xcache.admin.enable_auth')) {
$max = xcache_count(XC_TYPE_PHP);
for ($i = 0; $i < $max; $i++) {
if (!xcache_clear_cache(XC_TYPE_PHP, $i)) {
break;
}
}
}
}
示例2: bx_accelerator_reset
function bx_accelerator_reset()
{
if ($GLOBALS['____257916564'][13](___575231538(13))) {
accelerator_reset();
} elseif ($GLOBALS['____257916564'][14](___575231538(14))) {
wincache_refresh_if_changed();
}
}
示例3: bx_accelerator_reset
function bx_accelerator_reset()
{
if ($GLOBALS['____626942765'][16](___283096063(16))) {
accelerator_reset();
} elseif ($GLOBALS['____626942765'][17](___283096063(17))) {
wincache_refresh_if_changed();
}
}
示例4: bx_accelerator_reset
function bx_accelerator_reset()
{
if ($GLOBALS['____716757992'][13](___781194072(13))) {
accelerator_reset();
} elseif ($GLOBALS['____716757992'][14](___781194072(14))) {
wincache_refresh_if_changed();
}
}
示例5: bx_accelerator_reset
function bx_accelerator_reset()
{
if ($GLOBALS['____2058819955'][16](___1032422006(16))) {
accelerator_reset();
} elseif ($GLOBALS['____2058819955'][17](___1032422006(17))) {
wincache_refresh_if_changed();
}
}
示例6: bx_accelerator_reset
function bx_accelerator_reset()
{
if ($GLOBALS['____467353288'][16](___1498308727(16))) {
accelerator_reset();
} elseif ($GLOBALS['____467353288'][17](___1498308727(17))) {
wincache_refresh_if_changed();
}
}
示例7: bx_accelerator_reset
function bx_accelerator_reset()
{
if ($GLOBALS['____1513245363'][16](___1595018847(16))) {
accelerator_reset();
} elseif ($GLOBALS['____1513245363'][17](___1595018847(17))) {
wincache_refresh_if_changed();
}
}
示例8: bx_accelerator_reset
function bx_accelerator_reset()
{
if ($GLOBALS['____1595852040'][16](___1664354704(16))) {
accelerator_reset();
} elseif ($GLOBALS['____1595852040'][17](___1664354704(17))) {
wincache_refresh_if_changed();
}
}
示例9: bx_accelerator_reset
function bx_accelerator_reset()
{
if ($GLOBALS['____686248920'][13](___424308761(13))) {
accelerator_reset();
} elseif ($GLOBALS['____686248920'][14](___424308761(14))) {
wincache_refresh_if_changed();
}
}
示例10: bx_accelerator_reset
function bx_accelerator_reset()
{
if ($GLOBALS['____780604396'][16](___1088551736(16))) {
accelerator_reset();
} elseif ($GLOBALS['____780604396'][17](___1088551736(17))) {
wincache_refresh_if_changed();
}
}
示例11: bx_accelerator_reset
function bx_accelerator_reset()
{
if ($GLOBALS['____1606645557'][16](___2114809146(16))) {
accelerator_reset();
} elseif ($GLOBALS['____1606645557'][17](___2114809146(17))) {
wincache_refresh_if_changed();
}
}
示例12: cleanAccelerator
protected function cleanAccelerator()
{
try {
echo "Cleaning accelerator... ";
flush();
accelerator_reset();
echo "[OK]" . PHP_EOL . PHP_EOL;
} catch (Exception $e) {
die("[ERROR:" . $e->getMessage() . "]" . PHP_EOL);
}
}
示例13: initialize
/**
* Initialize the cache properties
*/
protected static function initialize()
{
$apcVersion = phpversion('apc');
$xcVersion = phpversion('xcache');
static::$supportedCaches = array('OPcache' => array('active' => extension_loaded('Zend OPcache') && ini_get('opcache.enable') === '1', 'version' => phpversion('Zend OPcache'), 'canReset' => TRUE, 'canInvalidate' => function_exists('opcache_invalidate'), 'error' => FALSE, 'clearCallback' => function ($fileAbsPath) {
if ($fileAbsPath !== NULL && function_exists('opcache_invalidate')) {
opcache_invalidate($fileAbsPath);
} else {
opcache_reset();
}
}), 'APC' => array('active' => extension_loaded('apc') && !extension_loaded('apcu') && ini_get('apc.enabled') === '1', 'version' => $apcVersion, 'canReset' => TRUE, 'canInvalidate' => self::canApcInvalidate(), 'error' => $apcVersion && VersionNumberUtility::convertVersionNumberToInteger($apcVersion) < 3001007, 'clearCallback' => function ($fileAbsPath) {
if ($fileAbsPath !== NULL && OpcodeCacheUtility::getCanInvalidate('APC')) {
// This may output a warning like: PHP Warning: apc_delete_file(): Could not stat file
// This warning isn't true, this means that apc was unable to generate the cache key
// which depends on the configuration of APC.
apc_delete_file($fileAbsPath);
} else {
apc_clear_cache('opcode');
}
}), 'WinCache' => array('active' => extension_loaded('wincache') && ini_get('wincache.ocenabled') === '1', 'version' => phpversion('wincache'), 'canReset' => FALSE, 'canInvalidate' => TRUE, 'error' => FALSE, 'clearCallback' => function ($fileAbsPath) {
if ($fileAbsPath !== NULL) {
wincache_refresh_if_changed(array($fileAbsPath));
} else {
// No argument means refreshing all.
wincache_refresh_if_changed();
}
}), 'XCache' => array('active' => extension_loaded('xcache'), 'version' => $xcVersion, 'canReset' => TRUE, 'canInvalidate' => FALSE, 'error' => FALSE, 'clearCallback' => $xcVersion && VersionNumberUtility::convertVersionNumberToInteger($xcVersion) < 3000000 ? function ($fileAbsPath) {
if (!ini_get('xcache.admin.enable_auth')) {
xcache_clear_cache(XC_TYPE_PHP, 0);
}
} : function ($fileAbsPath) {
if (!ini_get('xcache.admin.enable_auth')) {
xcache_clear_cache(XC_TYPE_PHP);
}
}), 'eAccelerator' => array('active' => extension_loaded('eAccelerator'), 'version' => phpversion('eaccelerator'), 'canReset' => FALSE, 'canInvalidate' => FALSE, 'error' => TRUE, 'clearCallback' => function ($fileAbsPath) {
eaccelerator_clear();
}), 'ZendOptimizerPlus' => array('active' => extension_loaded('Zend Optimizer+') && ini_get('zend_optimizerplus.enable') === '1', 'version' => phpversion('Zend Optimizer+'), 'canReset' => TRUE, 'canInvalidate' => FALSE, 'error' => FALSE, 'clearCallback' => function ($fileAbsPath) {
accelerator_reset();
}));
static::$activeCaches = array();
// Cache the active ones
foreach (static::$supportedCaches as $opcodeCache => $properties) {
if ($properties['active']) {
static::$activeCaches[$opcodeCache] = $properties;
}
}
}
示例14: init
public function init()
{
parent::init();
// clear the opcache (as of PHP 5.5)
if (function_exists("opcache_reset")) {
opcache_reset();
}
// clear the APC opcode cache (<= PHP 5.4)
if (function_exists("apc_clear_cache")) {
apc_clear_cache();
}
// clear the Zend Optimizer cache (Zend Server <= PHP 5.4)
if (function_exists('accelerator_reset')) {
return accelerator_reset();
}
$this->checkPermission("update");
}
示例15: initialize
/**
* Initialize the cache properties
*
* @return void
*/
protected static function initialize()
{
$apcVersion = phpversion('apc');
$xcVersion = phpversion('xcache');
static::$supportedCaches = array('OPcache' => array('active' => extension_loaded('Zend OPcache') && ini_get('opcache.enable') === '1', 'version' => phpversion('Zend OPcache'), 'canReset' => true, 'canInvalidate' => function_exists('opcache_invalidate'), 'error' => false, 'clearCallback' => function ($fileAbsPath) {
if ($fileAbsPath !== null && function_exists('opcache_invalidate')) {
opcache_invalidate($fileAbsPath, true);
} else {
opcache_reset();
}
}), 'APC' => array('active' => extension_loaded('apc') && !extension_loaded('apcu') && ini_get('apc.enabled') === '1', 'version' => $apcVersion, 'canReset' => true, 'canInvalidate' => self::canApcInvalidate(), 'error' => $apcVersion && version_compare($apcVersion, '3.1.7', '<'), 'clearCallback' => function ($fileAbsPath) {
if ($fileAbsPath !== null && iMSCP_Utility_OpcodeCache::getCanInvalidate('APC')) {
// This may output a warning like: PHP Warning: apc_delete_file(): Could not stat file
// This warning isn't true, this means that apc was unable to generate the cache key
// which depends on the configuration of APC.
@apc_delete_file($fileAbsPath);
} else {
apc_clear_cache('opcode');
}
}), 'XCache' => array('active' => extension_loaded('xcache'), 'version' => $xcVersion, 'canReset' => true, 'canInvalidate' => false, 'error' => false, 'clearCallback' => $xcVersion && version_compare($xcVersion, '3.0.0', '<') ? function () {
if (!ini_get('xcache.admin.enable_auth')) {
xcache_clear_cache(XC_TYPE_PHP, 0);
}
} : function () {
if (!ini_get('xcache.admin.enable_auth')) {
xcache_clear_cache(XC_TYPE_PHP);
}
}), 'eAccelerator' => array('active' => extension_loaded('eAccelerator'), 'version' => phpversion('eaccelerator'), 'canReset' => false, 'canInvalidate' => false, 'error' => false, 'clearCallback' => function () {
eaccelerator_clear();
}), 'ZendOptimizerPlus' => array('active' => extension_loaded('Zend Optimizer+') && ini_get('zend_optimizerplus.enable') === '1', 'version' => phpversion('Zend Optimizer+'), 'canReset' => true, 'canInvalidate' => false, 'error' => false, 'clearCallback' => function () {
accelerator_reset();
}));
static::$activeCaches = array();
// Cache the active ones
foreach (static::$supportedCaches as $opcodeCache => $properties) {
if ($properties['active']) {
static::$activeCaches[$opcodeCache] = $properties;
}
}
}