Closed jianzhong closed 10 years ago
In Apc.conf
:
public function getIds()
{
$res = array();
$array = apc_cache_info('user', false);
var_dump($array['cache_list']);
$records = $array['cache_list'];
foreach ($records as $record) {
$res[] = $record['info'];
}
return $res;
}
I fixed it temporarily like this:
public function getIds()
{
$res = array();
$array = apc_cache_info('user', false);
var_dump($array['cache_list']);
$records = $array['cache_list'];
foreach ($records as $record) {
if (isset($record['info'])) {
$res[] = $record['info'];
} else {
$res[] = $record['key'];
}
}
return $res;
}
But cleaner solution would probably be to use APCIterator
instead of relying on the apc_cache_info
structure which can change.
The
getIds()
method is looking for an array item indexed with 'info' in the array returned by calling apc_cache_info(), but the key doesn't exist. The key name has changed to 'key', instead of 'info'. See theapc_cache_info()
return value below.My php version is 5.5.3, and has APCu module enabled.