Strict type check for null cache values

Previously, generated cache results that returned 0, '', array() etc
were being ignored. This change narrows it down to just false.

Ideally we would use a EmptyCacheHit object to be very specific for
these cases, but perhaps this approach is a bit overkill.
This commit is contained in:
Will Morgan 2013-10-24 18:01:20 +01:00
parent 723c4e3f4e
commit ceab35a0be

View File

@ -1077,10 +1077,12 @@ abstract class Object {
if($ID) $cacheName .= '_' . $ID;
if(count($arguments)) $cacheName .= '_' . md5(serialize($arguments));
if($data = $this->loadCache($cacheName, $lifetime)) {
$data = $this->loadCache($cacheName, $lifetime);
if($data !== false) {
return $data;
}
$data = call_user_func_array(array($this, $method), $arguments);
$this->saveCache($cacheName, $data);