forked from GNUsocial/gnu-social
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
This commit is contained in:
commit
22a88fb850
@ -90,17 +90,16 @@ class Memcached_DataObject extends DB_DataObject
|
|||||||
unset($i);
|
unset($i);
|
||||||
}
|
}
|
||||||
$i = Memcached_DataObject::getcached($cls, $k, $v);
|
$i = Memcached_DataObject::getcached($cls, $k, $v);
|
||||||
if ($i !== false) { // false == cache miss
|
if ($i === false) { // false == cache miss
|
||||||
return $i;
|
|
||||||
} else {
|
|
||||||
$i = DB_DataObject::factory($cls);
|
$i = DB_DataObject::factory($cls);
|
||||||
if (empty($i)) {
|
if (empty($i)) {
|
||||||
return false;
|
$i = false;
|
||||||
|
return $i;
|
||||||
}
|
}
|
||||||
$result = $i->get($k, $v);
|
$result = $i->get($k, $v);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
|
// Hit!
|
||||||
$i->encache();
|
$i->encache();
|
||||||
return $i;
|
|
||||||
} else {
|
} else {
|
||||||
// save the fact that no such row exists
|
// save the fact that no such row exists
|
||||||
$c = self::memcache();
|
$c = self::memcache();
|
||||||
@ -108,12 +107,16 @@ class Memcached_DataObject extends DB_DataObject
|
|||||||
$ck = self::cachekey($cls, $k, $v);
|
$ck = self::cachekey($cls, $k, $v);
|
||||||
$c->set($ck, null);
|
$c->set($ck, null);
|
||||||
}
|
}
|
||||||
return false;
|
$i = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return $i;
|
||||||
}
|
}
|
||||||
|
|
||||||
function &pkeyGet($cls, $kv)
|
/**
|
||||||
|
* @fixme Should this return false on lookup fail to match staticGet?
|
||||||
|
*/
|
||||||
|
function pkeyGet($cls, $kv)
|
||||||
{
|
{
|
||||||
$i = Memcached_DataObject::multicache($cls, $kv);
|
$i = Memcached_DataObject::multicache($cls, $kv);
|
||||||
if ($i !== false) { // false == cache miss
|
if ($i !== false) { // false == cache miss
|
||||||
|
@ -128,6 +128,8 @@ function console_help()
|
|||||||
if (CONSOLE_INTERACTIVE) {
|
if (CONSOLE_INTERACTIVE) {
|
||||||
print "StatusNet interactive PHP console... type ctrl+D or enter 'exit' to exit.\n";
|
print "StatusNet interactive PHP console... type ctrl+D or enter 'exit' to exit.\n";
|
||||||
$prompt = common_config('site', 'name') . '> ';
|
$prompt = common_config('site', 'name') . '> ';
|
||||||
|
} else {
|
||||||
|
$prompt = '';
|
||||||
}
|
}
|
||||||
while (!feof(STDIN)) {
|
while (!feof(STDIN)) {
|
||||||
$line = read_input_line($prompt);
|
$line = read_input_line($prompt);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user