summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-01-01 11:26:50 -1000
committerEvan Prodromou <evan@status.net>2010-01-01 11:26:50 -1000
commite33b9a8ab80f1daa1861f381773031b10b8c58d1 (patch)
tree2ebee04d5bb0afe3848dd8e1c7877e7b11665b1b
parent55ba858e8cb4eac0fa60fb78f8e8c4813be065a9 (diff)
parentb0527801d9c2b84408bbfdf82bbdc5b778f72cfc (diff)
Merge branch 'master' into batchlocation
-rw-r--r--classes/Memcached_DataObject.php24
1 files changed, 21 insertions, 3 deletions
diff --git a/classes/Memcached_DataObject.php b/classes/Memcached_DataObject.php
index d8b0db5a6..cf7fb4340 100644
--- a/classes/Memcached_DataObject.php
+++ b/classes/Memcached_DataObject.php
@@ -51,11 +51,17 @@ class Memcached_DataObject extends DB_DataObject
if ($i) {
return $i;
} else {
- $i = DB_DataObject::staticGet($cls, $k, $v);
- if ($i) {
+ $i = DB_DataObject::factory($cls);
+ if (empty($i)) {
+ return null;
+ }
+ $result = $i->get($k, $v);
+ if ($result) {
$i->encache();
+ return $i;
+ } else {
+ return null;
}
- return $i;
}
}
@@ -247,6 +253,18 @@ class Memcached_DataObject extends DB_DataObject
return new ArrayWrapper($cached);
}
+ function cleanup()
+ {
+ global $_DB_DATAOBJECT;
+
+ if (isset($_DB_DATAOBJECT['RESULTFIELDS'][$this->_DB_resultid])) {
+ unset($_DB_DATAOBJECT['RESULTFIELDS'][$this->_DB_resultid]);
+ }
+ if (isset($_DB_DATAOBJECT['RESULTS'][$this->_DB_resultid])) {
+ unset($_DB_DATAOBJECT['RESULTS'][$this->_DB_resultid]);
+ }
+ }
+
// We overload so that 'SET NAMES "utf8"' is called for
// each connection