Merge branch 'master' into batchlocation

This commit is contained in:
Evan Prodromou 2010-01-01 11:26:50 -10:00
commit e33b9a8ab8

View File

@ -51,11 +51,17 @@ class Memcached_DataObject extends DB_DataObject
if ($i) { if ($i) {
return $i; return $i;
} else { } else {
$i = DB_DataObject::staticGet($cls, $k, $v); $i = DB_DataObject::factory($cls);
if ($i) { if (empty($i)) {
$i->encache(); 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); 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 // We overload so that 'SET NAMES "utf8"' is called for
// each connection // each connection