summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorSarven Capadisli <csarven@status.net>2010-01-07 09:53:29 +0000
committerSarven Capadisli <csarven@status.net>2010-01-07 09:53:29 +0000
commite53512cd2c2180f81fc7317de9df09a140099aa3 (patch)
tree0ce2990af79feb5c2fb048841d0c61c184dbba00 /classes
parentd17c2d8ebacb799e7dd6bebe249df765ea918880 (diff)
parentf4fa785fb7cf6f222f77ad81f6a1e50e5af7fdf3 (diff)
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
Diffstat (limited to 'classes')
-rw-r--r--classes/Avatar.php2
-rw-r--r--classes/Config.php2
-rw-r--r--classes/Fave.php2
-rw-r--r--classes/File_to_post.php2
-rw-r--r--classes/Group_block.php2
-rw-r--r--classes/Group_inbox.php2
-rw-r--r--classes/Group_member.php2
-rw-r--r--classes/Memcached_DataObject.php21
-rw-r--r--classes/Notice_inbox.php2
-rw-r--r--classes/Notice_tag.php2
-rw-r--r--classes/Profile.php1
-rw-r--r--classes/Profile_role.php2
-rw-r--r--classes/Queue_item.php2
-rw-r--r--classes/Subscription.php2
14 files changed, 26 insertions, 20 deletions
diff --git a/classes/Avatar.php b/classes/Avatar.php
index 8d6424e8b..91bde0f04 100644
--- a/classes/Avatar.php
+++ b/classes/Avatar.php
@@ -37,7 +37,7 @@ class Avatar extends Memcached_DataObject
}
}
- function &pkeyGet($kv)
+ function pkeyGet($kv)
{
return Memcached_DataObject::pkeyGet('Avatar', $kv);
}
diff --git a/classes/Config.php b/classes/Config.php
index 6d914ca1f..43b99587f 100644
--- a/classes/Config.php
+++ b/classes/Config.php
@@ -120,7 +120,7 @@ class Config extends Memcached_DataObject
return $result;
}
- function &pkeyGet($kv)
+ function pkeyGet($kv)
{
return Memcached_DataObject::pkeyGet('Config', $kv);
}
diff --git a/classes/Fave.php b/classes/Fave.php
index 11e876ff1..8113c8e16 100644
--- a/classes/Fave.php
+++ b/classes/Fave.php
@@ -32,7 +32,7 @@ class Fave extends Memcached_DataObject
return $fave;
}
- function &pkeyGet($kv)
+ function pkeyGet($kv)
{
return Memcached_DataObject::pkeyGet('Fave', $kv);
}
diff --git a/classes/File_to_post.php b/classes/File_to_post.php
index e3db91b20..72a42b088 100644
--- a/classes/File_to_post.php
+++ b/classes/File_to_post.php
@@ -62,7 +62,7 @@ class File_to_post extends Memcached_DataObject
}
}
- function &pkeyGet($kv)
+ function pkeyGet($kv)
{
return Memcached_DataObject::pkeyGet('File_to_post', $kv);
}
diff --git a/classes/Group_block.php b/classes/Group_block.php
index de2cf5f6e..9f4d59295 100644
--- a/classes/Group_block.php
+++ b/classes/Group_block.php
@@ -40,7 +40,7 @@ class Group_block extends Memcached_DataObject
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
- function &pkeyGet($kv)
+ function pkeyGet($kv)
{
return Memcached_DataObject::pkeyGet('Group_block', $kv);
}
diff --git a/classes/Group_inbox.php b/classes/Group_inbox.php
index 1af7439f7..2a0787e38 100644
--- a/classes/Group_inbox.php
+++ b/classes/Group_inbox.php
@@ -20,7 +20,7 @@ class Group_inbox extends Memcached_DataObject
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
- function &pkeyGet($kv)
+ function pkeyGet($kv)
{
return Memcached_DataObject::pkeyGet('Group_inbox', $kv);
}
diff --git a/classes/Group_member.php b/classes/Group_member.php
index 3c23a991f..069b2c7a1 100644
--- a/classes/Group_member.php
+++ b/classes/Group_member.php
@@ -21,7 +21,7 @@ class Group_member extends Memcached_DataObject
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
- function &pkeyGet($kv)
+ function pkeyGet($kv)
{
return Memcached_DataObject::pkeyGet('Group_member', $kv);
}
diff --git a/classes/Memcached_DataObject.php b/classes/Memcached_DataObject.php
index d11bd6368..4e3cc5678 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
@@ -143,7 +146,9 @@ class Memcached_DataObject extends DB_DataObject
function insert()
{
$result = parent::insert();
- $this->encache(); // in case of cached negative lookups
+ if ($result) {
+ $this->encache(); // in case of cached negative lookups
+ }
return $result;
}
diff --git a/classes/Notice_inbox.php b/classes/Notice_inbox.php
index d3ddad656..e350e6e2f 100644
--- a/classes/Notice_inbox.php
+++ b/classes/Notice_inbox.php
@@ -101,7 +101,7 @@ class Notice_inbox extends Memcached_DataObject
return $ids;
}
- function &pkeyGet($kv)
+ function pkeyGet($kv)
{
return Memcached_DataObject::pkeyGet('Notice_inbox', $kv);
}
diff --git a/classes/Notice_tag.php b/classes/Notice_tag.php
index 02740280f..79231f0b0 100644
--- a/classes/Notice_tag.php
+++ b/classes/Notice_tag.php
@@ -96,7 +96,7 @@ class Notice_tag extends Memcached_DataObject
}
}
- function &pkeyGet($kv)
+ function pkeyGet($kv)
{
return Memcached_DataObject::pkeyGet('Notice_tag', $kv);
}
diff --git a/classes/Profile.php b/classes/Profile.php
index 03196447b..25d908dbf 100644
--- a/classes/Profile.php
+++ b/classes/Profile.php
@@ -504,6 +504,7 @@ class Profile extends Memcached_DataObject
'Reply',
'Group_member',
);
+ Event::handle('ProfileDeleteRelated', array($this, &$related));
foreach ($related as $cls) {
$inst = new $cls();
diff --git a/classes/Profile_role.php b/classes/Profile_role.php
index afa7fb74e..74aca3730 100644
--- a/classes/Profile_role.php
+++ b/classes/Profile_role.php
@@ -43,7 +43,7 @@ class Profile_role extends Memcached_DataObject
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
- function &pkeyGet($kv)
+ function pkeyGet($kv)
{
return Memcached_DataObject::pkeyGet('Profile_role', $kv);
}
diff --git a/classes/Queue_item.php b/classes/Queue_item.php
index 295c321b5..9c673540d 100644
--- a/classes/Queue_item.php
+++ b/classes/Queue_item.php
@@ -55,7 +55,7 @@ class Queue_item extends Memcached_DataObject
return null;
}
- function &pkeyGet($kv)
+ function pkeyGet($kv)
{
return Memcached_DataObject::pkeyGet('Queue_item', $kv);
}
diff --git a/classes/Subscription.php b/classes/Subscription.php
index fedfd5f19..faf1331cd 100644
--- a/classes/Subscription.php
+++ b/classes/Subscription.php
@@ -46,7 +46,7 @@ class Subscription extends Memcached_DataObject
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
- function &pkeyGet($kv)
+ function pkeyGet($kv)
{
return Memcached_DataObject::pkeyGet('Subscription', $kv);
}