From 8f81762d68ede590e53b929c77602f0e2db0ddc2 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 6 Sep 2010 09:56:45 -0400 Subject: common_memcache() => Cache::instance() --- classes/Memcached_DataObject.php | 2 +- classes/Notice.php | 6 +++--- classes/Profile.php | 16 ++++++++-------- classes/User.php | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) (limited to 'classes') diff --git a/classes/Memcached_DataObject.php b/classes/Memcached_DataObject.php index 0f1ed0489..0c46ef2b4 100644 --- a/classes/Memcached_DataObject.php +++ b/classes/Memcached_DataObject.php @@ -124,7 +124,7 @@ class Memcached_DataObject extends Safe_DataObject } static function memcache() { - return common_memcache(); + return Cache::instance(); } static function cacheKey($cls, $k, $v) { diff --git a/classes/Notice.php b/classes/Notice.php index 14477b1b5..066e7a584 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -591,7 +591,7 @@ class Notice extends Memcached_DataObject function getStreamByIds($ids) { - $cache = common_memcache(); + $cache = Cache::instance(); if (!empty($cache)) { $notices = array(); @@ -1585,7 +1585,7 @@ class Notice extends Memcached_DataObject function stream($fn, $args, $cachekey, $offset=0, $limit=20, $since_id=0, $max_id=0) { - $cache = common_memcache(); + $cache = Cache::instance(); if (empty($cache) || $since_id != 0 || $max_id != 0 || @@ -1777,7 +1777,7 @@ class Notice extends Memcached_DataObject function repeatStream($limit=100) { - $cache = common_memcache(); + $cache = Cache::instance(); if (empty($cache)) { $ids = $this->_repeatStreamDirect($limit); diff --git a/classes/Profile.php b/classes/Profile.php index 8f8679550..19564408c 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -429,7 +429,7 @@ class Profile extends Memcached_DataObject function subscriptionCount() { - $c = common_memcache(); + $c = Cache::instance(); if (!empty($c)) { $cnt = $c->get(common_cache_key('profile:subscription_count:'.$this->id)); @@ -454,7 +454,7 @@ class Profile extends Memcached_DataObject function subscriberCount() { - $c = common_memcache(); + $c = Cache::instance(); if (!empty($c)) { $cnt = $c->get(common_cache_key('profile:subscriber_count:'.$this->id)); if (is_integer($cnt)) { @@ -476,7 +476,7 @@ class Profile extends Memcached_DataObject function faveCount() { - $c = common_memcache(); + $c = Cache::instance(); if (!empty($c)) { $cnt = $c->get(common_cache_key('profile:fave_count:'.$this->id)); if (is_integer($cnt)) { @@ -497,7 +497,7 @@ class Profile extends Memcached_DataObject function noticeCount() { - $c = common_memcache(); + $c = Cache::instance(); if (!empty($c)) { $cnt = $c->get(common_cache_key('profile:notice_count:'.$this->id)); @@ -519,7 +519,7 @@ class Profile extends Memcached_DataObject function blowSubscriberCount() { - $c = common_memcache(); + $c = Cache::instance(); if (!empty($c)) { $c->delete(common_cache_key('profile:subscriber_count:'.$this->id)); } @@ -527,7 +527,7 @@ class Profile extends Memcached_DataObject function blowSubscriptionCount() { - $c = common_memcache(); + $c = Cache::instance(); if (!empty($c)) { $c->delete(common_cache_key('profile:subscription_count:'.$this->id)); } @@ -535,7 +535,7 @@ class Profile extends Memcached_DataObject function blowFaveCount() { - $c = common_memcache(); + $c = Cache::instance(); if (!empty($c)) { $c->delete(common_cache_key('profile:fave_count:'.$this->id)); } @@ -543,7 +543,7 @@ class Profile extends Memcached_DataObject function blowNoticeCount() { - $c = common_memcache(); + $c = Cache::instance(); if (!empty($c)) { $c->delete(common_cache_key('profile:notice_count:'.$this->id)); } diff --git a/classes/User.php b/classes/User.php index 70e09c1dc..36db22612 100644 --- a/classes/User.php +++ b/classes/User.php @@ -388,7 +388,7 @@ class User extends Memcached_DataObject function hasFave($notice) { - $cache = common_memcache(); + $cache = Cache::instance(); // XXX: Kind of a hack. @@ -487,7 +487,7 @@ class User extends Memcached_DataObject function blowFavesCache() { - $cache = common_memcache(); + $cache = Cache::instance(); if ($cache) { // Faves don't happen chronologically, so we need to blow // ;last cache, too -- cgit v1.2.3-54-g00ecf