Avoid spewing warnings about returning by reference on memcached cache misses by setting a var and returning it instead of trying to return false directly.

This hacky workaround is brought to you by DB_DataObject's PHP 4 roots.
This commit is contained in:
Brion Vibber 2010-01-12 12:20:45 -08:00
parent 9c34d5c107
commit 4cc9b183d7
1 changed files with 4 additions and 2 deletions

View File

@ -98,14 +98,16 @@ class Memcached_DataObject extends DB_DataObject
} else {
$i = DB_DataObject::factory($cls);
if (empty($i)) {
return false;
$i = false;
return $i;
}
$result = $i->get($k, $v);
if ($result) {
$i->encache();
return $i;
} else {
return false;
$i = false;
return $i;
}
}
}