本文整理汇总了PHP中wincache_refresh_if_changed函数的典型用法代码示例。如果您正苦于以下问题:PHP wincache_refresh_if_changed函数的具体用法?PHP wincache_refresh_if_changed怎么用?PHP wincache_refresh_if_changed使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wincache_refresh_if_changed函数的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: getAllActive
/**
* Returns all supported and active opcaches
*
* @return array Array filled with supported and active opcaches
*/
public function getAllActive()
{
$xcVersion = phpversion('xcache');
$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();
}
}), 'WinCache' => array('active' => extension_loaded('wincache') && ini_get('wincache.ocenabled') === '1', 'version' => phpversion('wincache'), 'canReset' => TRUE, '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' => !ini_get('xcache.admin.enable_auth'), 'canInvalidate' => FALSE, 'error' => FALSE, 'clearCallback' => function ($fileAbsPath) {
if (!ini_get('xcache.admin.enable_auth')) {
xcache_clear_cache(XC_TYPE_PHP);
}
}));
$activeCaches = array();
foreach ($supportedCaches as $opcodeCache => $properties) {
if ($properties['active']) {
$activeCaches[$opcodeCache] = $properties;
}
}
return $activeCaches;
}
示例3: initialize
/**
* Initialize the ClearCache-Callbacks
*
* @return void
*/
protected static function initialize()
{
self::$clearCacheCallbacks = array();
// Zend OpCache (built in by default since PHP 5.5) - http://php.net/manual/de/book.opcache.php
if (extension_loaded('Zend OPcache') && ini_get('opcache.enable') === '1') {
self::$clearCacheCallbacks[] = function ($absolutePathAndFilename) {
if ($absolutePathAndFilename !== null && function_exists('opcache_invalidate')) {
opcache_invalidate($absolutePathAndFilename);
} else {
opcache_reset();
}
};
}
// WinCache - http://www.php.net/manual/de/book.wincache.php
if (extension_loaded('wincache') && ini_get('wincache.ocenabled') === '1') {
self::$clearCacheCallbacks[] = function ($absolutePathAndFilename) {
if ($absolutePathAndFilename !== null) {
wincache_refresh_if_changed(array($absolutePathAndFilename));
} else {
// Refresh everything!
wincache_refresh_if_changed();
}
};
}
// XCache - http://xcache.lighttpd.net/
// Supported in version >= 3.0.1
if (extension_loaded('xcache')) {
self::$clearCacheCallbacks[] = function ($absolutePathAndFilename) {
// XCache can only be fully cleared.
if (!ini_get('xcache.admin.enable_auth')) {
xcache_clear_cache(XC_TYPE_PHP);
}
};
}
}
示例4: 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();
}
}
示例5: 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();
}
}
示例6: 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();
}
}
示例7: 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();
}
}
示例8: 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();
}
}
示例9: 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();
}
}
示例10: 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();
}
}
示例11: 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();
}
}
示例12: 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();
}
}
示例13: 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();
}
}
示例14: clearOpcodeCaches
function clearOpcodeCaches()
{
if (ini_get('wincache.ocenabled')) {
wincache_refresh_if_changed();
}
if (ini_get('apc.enabled') && function_exists('apc_clear_cache')) {
apc_clear_cache();
}
}
示例15: 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;
}
}
}