forked from GNUsocial/gnu-social
Merge branch 'master' into 0.9.x
Conflicts: classes/Memcached_DataObject.php
This commit is contained in:
commit
a9d8359208
@ -60,18 +60,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)) {
|
||||||
// DB_DataObject's in-process lookup cache interferes with GC
|
return null;
|
||||||
// to cause massive memory leaks in long-running processes.
|
|
||||||
if (php_sapi_name() == 'cli') {
|
|
||||||
$i->_clear_cache();
|
|
||||||
}
|
}
|
||||||
|
$result = $i->get($k, $v);
|
||||||
// Now store it into the shared memcached, if present...
|
if ($result) {
|
||||||
$i->encache();
|
$i->encache();
|
||||||
}
|
|
||||||
return $i;
|
return $i;
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -263,6 +262,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
|
||||||
|
|
||||||
|
@ -191,6 +191,14 @@ class NoticeListItem extends Widget
|
|||||||
|
|
||||||
function show()
|
function show()
|
||||||
{
|
{
|
||||||
|
if (empty($this->notice)) {
|
||||||
|
common_log(LOG_WARNING, "Trying to show missing notice; skipping.");
|
||||||
|
return;
|
||||||
|
} else if (empty($this->profile)) {
|
||||||
|
common_log(LOG_WARNING, "Trying to show missing profile (" . $this->notice->profile_id . "); skipping.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$this->showStart();
|
$this->showStart();
|
||||||
if (Event::handle('StartShowNoticeItem', array($this))) {
|
if (Event::handle('StartShowNoticeItem', array($this))) {
|
||||||
$this->showNotice();
|
$this->showNotice();
|
||||||
|
Loading…
Reference in New Issue
Block a user