diff --git a/AcceleratorCacheClearer.php b/AcceleratorCacheClearer.php index 9063c9d..3f537f6 100644 --- a/AcceleratorCacheClearer.php +++ b/AcceleratorCacheClearer.php @@ -60,6 +60,15 @@ private static function clearUserCache() return 'APC User Cache: success.'; } + if (function_exists('xcache_clear_cache')) { + $cnt = xcache_count(XC_TYPE_VAR); + for ($i=0; $i < $cnt; $i++) { + xcache_clear_cache(XC_TYPE_VAR, $i); + } + + return 'XCache User Cache: success.'; + } + if (function_exists('wincache_ucache_clear') && wincache_ucache_clear()) { return 'Wincache User Cache: success.'; } @@ -80,6 +89,15 @@ private static function clearOpcodeCache() return 'APC Opcode Cache: success.'; } + if (function_exists('xcache_clear_cache')) { + $cnt = xcache_count(XC_TYPE_PHP); + for ($i=0; $i < $cnt; $i++) { + xcache_clear_cache(XC_TYPE_PHP, $i); + } + + return 'XCache Opcode Cache: success.'; + } + throw new \RuntimeException('Opcode Cache: failure.'); } }