summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-01-12 12:20:45 -0800
committerBrion Vibber <brion@pobox.com>2010-01-12 12:20:45 -0800
commit4cc9b183d797cbd3d1f6230a46cb5df6e6161dbb (patch)
treebf548351348d1892fd219cb9ee8615d55f42e647
parent9c34d5c1073133992ef56ed02be3f53c5cefa379 (diff)
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.
-rw-r--r--classes/Memcached_DataObject.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/classes/Memcached_DataObject.php b/classes/Memcached_DataObject.php
index b68a4af8e..9c9994cea 100644
--- a/classes/Memcached_DataObject.php
+++ b/classes/Memcached_DataObject.php
@@ -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;
}
}
}