summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-01-01 11:27:28 -1000
committerEvan Prodromou <evan@status.net>2010-01-01 11:27:28 -1000
commitd2bbf65f1915e259343b32934fa50cd693dbda26 (patch)
treef813368282c14c80ee1fa3c1eebc3b0fd4a8d57a /classes
parent79c2e3f7202aa652414df885bd4c917a316ea7f3 (diff)
parent89cca01259d71f3da961ef64def3647f86a01567 (diff)
Merge branch 'master' of git@gitorious.org:statusnet/mainline
Diffstat (limited to 'classes')
-rw-r--r--classes/Memcached_DataObject.php14
-rw-r--r--classes/Notice_inbox.php9
2 files changed, 9 insertions, 14 deletions
diff --git a/classes/Memcached_DataObject.php b/classes/Memcached_DataObject.php
index f51133508..bf61b0766 100644
--- a/classes/Memcached_DataObject.php
+++ b/classes/Memcached_DataObject.php
@@ -23,20 +23,6 @@ require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
class Memcached_DataObject extends DB_DataObject
{
- /**
- * Destructor to free global memory resources associated with
- * this data object when it's unset or goes out of scope.
- * DB_DataObject doesn't do this yet by itself.
- */
-
- function __destruct()
- {
- $this->free();
- if (method_exists('DB_DataObject', '__destruct')) {
- parent::__destruct();
- }
- }
-
function &staticGet($cls, $k, $v=null)
{
if (is_null($v)) {
diff --git a/classes/Notice_inbox.php b/classes/Notice_inbox.php
index b39006542..d3ddad656 100644
--- a/classes/Notice_inbox.php
+++ b/classes/Notice_inbox.php
@@ -106,6 +106,13 @@ class Notice_inbox extends Memcached_DataObject
return Memcached_DataObject::pkeyGet('Notice_inbox', $kv);
}
+ /**
+ * Trim inbox for a given user to latest NOTICE_INBOX_LIMIT items
+ * (up to NOTICE_INBOX_GC_MAX will be deleted).
+ *
+ * @param int $user_id
+ * @return int count of notices dropped from the inbox, if any
+ */
static function gc($user_id)
{
$entry = new Notice_inbox();
@@ -133,6 +140,8 @@ class Notice_inbox extends Memcached_DataObject
$notices = array();
}
}
+
+ return $total;
}
static function deleteMatching($user_id, $notices)