mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Apply patch from 'biesbjerg' to ApcEngine
This set of changes allows ApcEngine to work with APCu and newer versions of APC. Fixes #3749
This commit is contained in:
parent
6a8033aea2
commit
e683616329
1 changed files with 13 additions and 6 deletions
|
@ -125,12 +125,19 @@ class ApcEngine extends CacheEngine {
|
|||
if ($check) {
|
||||
return true;
|
||||
}
|
||||
$info = apc_cache_info('user');
|
||||
$cacheKeys = $info['cache_list'];
|
||||
unset($info);
|
||||
foreach ($cacheKeys as $key) {
|
||||
if (strpos($key['info'], $this->settings['prefix']) === 0) {
|
||||
apc_delete($key['info']);
|
||||
if (class_exists('APCIterator')) {
|
||||
$iterator = new APCIterator(
|
||||
'user',
|
||||
'/^' . preg_quote($this->settings['prefix'], '/') . '/',
|
||||
APC_ITER_NONE
|
||||
);
|
||||
apc_delete($iterator);
|
||||
} else {
|
||||
$cache = apc_cache_info('user');
|
||||
foreach ($cache['cache_list'] as $key) {
|
||||
if (strpos($key['info'], $this->settings['prefix']) === 0) {
|
||||
apc_delete($key['info']);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue