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:
parent
9c34d5c107
commit
4cc9b183d7
|
@ -98,14 +98,16 @@ class Memcached_DataObject extends DB_DataObject
|
||||||
} else {
|
} else {
|
||||||
$i = DB_DataObject::factory($cls);
|
$i = DB_DataObject::factory($cls);
|
||||||
if (empty($i)) {
|
if (empty($i)) {
|
||||||
return false;
|
$i = false;
|
||||||
|
return $i;
|
||||||
}
|
}
|
||||||
$result = $i->get($k, $v);
|
$result = $i->get($k, $v);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$i->encache();
|
$i->encache();
|
||||||
return $i;
|
return $i;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
$i = false;
|
||||||
|
return $i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user