summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2010-01-06 13:41:46 -0800
committerZach Copley <zach@status.net>2010-01-06 13:41:46 -0800
commit22a88fb850ecbfbf2c74accea605ee2942d3b0e4 (patch)
treeec5de5f23cbf38574c069f7baabc4bfdbd3a57f8
parent013e6dfdd481470cc02994b6db58a387a95016ca (diff)
parent85554d0840642f4c1b47b50202dd648db565781c (diff)
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
-rw-r--r--classes/Memcached_DataObject.php17
-rwxr-xr-xscripts/console.php2
2 files changed, 12 insertions, 7 deletions
diff --git a/classes/Memcached_DataObject.php b/classes/Memcached_DataObject.php
index d11bd6368..04f75b775 100644
--- a/classes/Memcached_DataObject.php
+++ b/classes/Memcached_DataObject.php
@@ -90,17 +90,16 @@ class Memcached_DataObject extends DB_DataObject
unset($i);
}
$i = Memcached_DataObject::getcached($cls, $k, $v);
- if ($i !== false) { // false == cache miss
- return $i;
- } else {
+ if ($i === false) { // false == cache miss
$i = DB_DataObject::factory($cls);
if (empty($i)) {
- return false;
+ $i = false;
+ return $i;
}
$result = $i->get($k, $v);
if ($result) {
+ // Hit!
$i->encache();
- return $i;
} else {
// save the fact that no such row exists
$c = self::memcache();
@@ -108,12 +107,16 @@ class Memcached_DataObject extends DB_DataObject
$ck = self::cachekey($cls, $k, $v);
$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);
if ($i !== false) { // false == cache miss
diff --git a/scripts/console.php b/scripts/console.php
index 329caf472..8b62a3a96 100755
--- a/scripts/console.php
+++ b/scripts/console.php
@@ -128,6 +128,8 @@ function console_help()
if (CONSOLE_INTERACTIVE) {
print "StatusNet interactive PHP console... type ctrl+D or enter 'exit' to exit.\n";
$prompt = common_config('site', 'name') . '> ';
+} else {
+ $prompt = '';
}
while (!feof(STDIN)) {
$line = read_input_line($prompt);