Skip to content

Commit

Permalink
Merge pull request #21 from nico-incubiq/master
Browse files Browse the repository at this point in the history
Added support for XCache.
  • Loading branch information
Web solutions authored and Web solutions committed May 11, 2016
2 parents 9a02b70 + bc286c8 commit f34417a
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions AcceleratorCacheClearer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.';
}
Expand All @@ -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.');
}
}

0 comments on commit f34417a

Please sign in to comment.