]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Avoid spewing warnings about returning by reference on memcached cache misses by...
authorBrion Vibber <brion@pobox.com>
Tue, 12 Jan 2010 20:20:45 +0000 (12:20 -0800)
committerBrion Vibber <brion@pobox.com>
Tue, 12 Jan 2010 20:20:45 +0000 (12:20 -0800)
This hacky workaround is brought to you by DB_DataObject's PHP 4 roots.

classes/Memcached_DataObject.php

index b68a4af8eb91f0ab779c305142b552d85dede6a2..9c9994ceace008b35b1ae733bcf281a0657bded4 100644 (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;
             }
         }
     }