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 d580e1235..b56e508c6 100644
--- a/classes/Profile.php
+++ b/classes/Profile.php
@@ -449,10 +449,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;
}
@@ -466,7 +466,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;
@@ -474,9 +474,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;
}
@@ -488,7 +488,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;
@@ -496,7 +496,7 @@ class Profile extends Memcached_DataObject
function hasFave($notice)
{
- $cache = common_memcache();
+ $cache = Cache::instance();
// XXX: Kind of a hack.
@@ -531,9 +531,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;
}
@@ -544,7 +544,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;
@@ -552,10 +552,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;
}
@@ -566,7 +566,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;
@@ -574,47 +574,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));
}
}