summaryrefslogtreecommitdiff
path: root/classes/Profile.php
diff options
context:
space:
mode:
Diffstat (limited to 'classes/Profile.php')
-rw-r--r--classes/Profile.php52
1 files changed, 26 insertions, 26 deletions
diff --git a/classes/Profile.php b/classes/Profile.php
index fe1a070bd..977947b6f 100644
--- a/classes/Profile.php
+++ b/classes/Profile.php
@@ -377,10 +377,10 @@ 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));
+ $cnt = $c->get(Cache::key('profile:subscription_count:'.$this->id));
if (is_integer($cnt)) {
return (int) $cnt;
}
@@ -394,7 +394,7 @@ class Profile extends Memcached_DataObject
$cnt = ($cnt > 0) ? $cnt - 1 : $cnt;
if (!empty($c)) {
- $c->set(common_cache_key('profile:subscription_count:'.$this->id), $cnt);
+ $c->set(Cache::key('profile:subscription_count:'.$this->id), $cnt);
}
return $cnt;
@@ -402,9 +402,9 @@ 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));
+ $cnt = $c->get(Cache::key('profile:subscriber_count:'.$this->id));
if (is_integer($cnt)) {
return (int) $cnt;
}
@@ -416,7 +416,7 @@ class Profile extends Memcached_DataObject
$cnt = (int) $sub->count('distinct subscriber');
if (!empty($c)) {
- $c->set(common_cache_key('profile:subscriber_count:'.$this->id), $cnt);
+ $c->set(Cache::key('profile:subscriber_count:'.$this->id), $cnt);
}
return $cnt;
@@ -447,7 +447,7 @@ class Profile extends Memcached_DataObject
function hasFave($notice)
{
- $cache = common_memcache();
+ $cache = Cache::instance();
// XXX: Kind of a hack.
@@ -482,9 +482,9 @@ 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));
+ $cnt = $c->get(Cache::key('profile:fave_count:'.$this->id));
if (is_integer($cnt)) {
return (int) $cnt;
}
@@ -495,7 +495,7 @@ class Profile extends Memcached_DataObject
$cnt = (int) $faves->count('distinct notice_id');
if (!empty($c)) {
- $c->set(common_cache_key('profile:fave_count:'.$this->id), $cnt);
+ $c->set(Cache::key('profile:fave_count:'.$this->id), $cnt);
}
return $cnt;
@@ -503,10 +503,10 @@ 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));
+ $cnt = $c->get(Cache::key('profile:notice_count:'.$this->id));
if (is_integer($cnt)) {
return (int) $cnt;
}
@@ -517,7 +517,7 @@ class Profile extends Memcached_DataObject
$cnt = (int) $notices->count('distinct id');
if (!empty($c)) {
- $c->set(common_cache_key('profile:notice_count:'.$this->id), $cnt);
+ $c->set(Cache::key('profile:notice_count:'.$this->id), $cnt);
}
return $cnt;
@@ -525,47 +525,47 @@ class Profile 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
- $cache->delete(common_cache_key('fave:ids_by_user:'.$this->id));
- $cache->delete(common_cache_key('fave:ids_by_user:'.$this->id.';last'));
- $cache->delete(common_cache_key('fave:ids_by_user_own:'.$this->id));
- $cache->delete(common_cache_key('fave:ids_by_user_own:'.$this->id.';last'));
+ $cache->delete(Cache::key('fave:ids_by_user:'.$this->id));
+ $cache->delete(Cache::key('fave:ids_by_user:'.$this->id.';last'));
+ $cache->delete(Cache::key('fave:ids_by_user_own:'.$this->id));
+ $cache->delete(Cache::key('fave:ids_by_user_own:'.$this->id.';last'));
}
$this->blowFaveCount();
}
function blowSubscriberCount()
{
- $c = common_memcache();
+ $c = Cache::instance();
if (!empty($c)) {
- $c->delete(common_cache_key('profile:subscriber_count:'.$this->id));
+ $c->delete(Cache::key('profile:subscriber_count:'.$this->id));
}
}
function blowSubscriptionCount()
{
- $c = common_memcache();
+ $c = Cache::instance();
if (!empty($c)) {
- $c->delete(common_cache_key('profile:subscription_count:'.$this->id));
+ $c->delete(Cache::key('profile:subscription_count:'.$this->id));
}
}
function blowFaveCount()
{
- $c = common_memcache();
+ $c = Cache::instance();
if (!empty($c)) {
- $c->delete(common_cache_key('profile:fave_count:'.$this->id));
+ $c->delete(Cache::key('profile:fave_count:'.$this->id));
}
}
function blowNoticeCount()
{
- $c = common_memcache();
+ $c = Cache::instance();
if (!empty($c)) {
- $c->delete(common_cache_key('profile:notice_count:'.$this->id));
+ $c->delete(Cache::key('profile:notice_count:'.$this->id));
}
}