]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Memcached_DataObject.php
Merge remote branch 'gitorious/0.9.x' into 1.0.x
[quix0rs-gnu-social.git] / classes / Memcached_DataObject.php
index 27bb5d3c9d6e32f58063f9e1320b5daa711d123f..b92b67e77557530827ca2bc919c9832dea77ad56 100644 (file)
@@ -74,7 +74,7 @@ class Memcached_DataObject extends Safe_DataObject
             return $i;
         } else {
             $i = DB_DataObject::factory($cls);
-            if (empty($i)) {
+            if (empty($i) || PEAR::isError($i)) {
                 return false;
             }
             foreach ($kv as $k => $v) {
@@ -339,10 +339,14 @@ class Memcached_DataObject extends Safe_DataObject
 
         $start = microtime(true);
         $fail = false;
-        try {
-            $result = parent::_query($string);
-        } catch (Exception $e) {
-            $fail = $e;
+        $result = null;
+        if (Event::handle('StartDBQuery', array($this, $string, &$result))) {
+            try {
+                $result = parent::_query($string);
+            } catch (Exception $e) {
+                $fail = $e;
+            }
+            Event::handle('EndDBQuery', array($this, $string, &$result));
         }
         $delta = microtime(true) - $start;