Issue #2332427 by neclimdul: Fixed APCUBackend makes incorrect assumptions about apc_fetch return type.

8.0.x
Nathaniel Catchpole 2014-09-10 10:29:25 +01:00
parent ea561c1082
commit f98fd49d73
1 changed files with 10 additions and 6 deletions

View File

@ -109,12 +109,14 @@ class ApcuBackend implements CacheBackendInterface {
$result = apc_fetch(array_keys($map)); $result = apc_fetch(array_keys($map));
$cache = array(); $cache = array();
if ($result) {
foreach ($result as $key => $item) { foreach ($result as $key => $item) {
$item = $this->prepareItem($item, $allow_invalid); $item = $this->prepareItem($item, $allow_invalid);
if ($item) { if ($item) {
$cache[$map[$key]] = $item; $cache[$map[$key]] = $item;
} }
} }
}
unset($result); unset($result);
$cids = array_diff($cids, array_keys($cache)); $cids = array_diff($cids, array_keys($cache));
@ -358,10 +360,12 @@ class ApcuBackend implements CacheBackendInterface {
foreach (array('deletions', 'invalidations') as $type) { foreach (array('deletions', 'invalidations') as $type) {
if ($query_tags[$type]) { if ($query_tags[$type]) {
$result = apc_fetch($query_tags[$type]); $result = apc_fetch($query_tags[$type]);
if ($result) {
static::$tagCache[$type] = array_merge(static::$tagCache[$type], $result); static::$tagCache[$type] = array_merge(static::$tagCache[$type], $result);
$checksum[$type] += array_sum($result); $checksum[$type] += array_sum($result);
} }
} }
}
return $checksum; return $checksum;
} }