diff options
author | Evan Prodromou <evan@status.net> | 2010-09-06 10:07:43 -0400 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-09-06 10:07:43 -0400 |
commit | a319b40c97c2fd6527eeb81d7d2f2d703756ef80 (patch) | |
tree | 19f849d8abddc24b609d33a5710efb97b37a972f /classes | |
parent | e42d2124a319e72f949fa354cc75252f32a5a6c5 (diff) |
common_cache_key() -> Cache::key()
Diffstat (limited to 'classes')
-rw-r--r-- | classes/Config.php | 6 | ||||
-rw-r--r-- | classes/Memcached_DataObject.php | 10 | ||||
-rw-r--r-- | classes/Notice.php | 10 | ||||
-rw-r--r-- | classes/Profile.php | 24 | ||||
-rw-r--r-- | classes/User.php | 8 |
5 files changed, 29 insertions, 29 deletions
diff --git a/classes/Config.php b/classes/Config.php index 43b99587f..e14730438 100644 --- a/classes/Config.php +++ b/classes/Config.php @@ -58,7 +58,7 @@ class Config extends Memcached_DataObject $c = self::memcache(); if (!empty($c)) { - $settings = $c->get(common_cache_key(self::settingsKey)); + $settings = $c->get(Cache::key(self::settingsKey)); if ($settings !== false) { return $settings; } @@ -77,7 +77,7 @@ class Config extends Memcached_DataObject $config->free(); if (!empty($c)) { - $c->set(common_cache_key(self::settingsKey), $settings); + $c->set(Cache::key(self::settingsKey), $settings); } return $settings; @@ -154,7 +154,7 @@ class Config extends Memcached_DataObject $c = self::memcache(); if (!empty($c)) { - $c->delete(common_cache_key(self::settingsKey)); + $c->delete(Cache::key(self::settingsKey)); } } } diff --git a/classes/Memcached_DataObject.php b/classes/Memcached_DataObject.php index 1c5245b7a..6feb59c34 100644 --- a/classes/Memcached_DataObject.php +++ b/classes/Memcached_DataObject.php @@ -134,7 +134,7 @@ class Memcached_DataObject extends Safe_DataObject str_replace("\n", " ", $e->getTraceAsString())); } $vstr = self::valueString($v); - return common_cache_key(strtolower($cls).':'.$k.':'.$vstr); + return Cache::key(strtolower($cls).':'.$k.':'.$vstr); } static function getcached($cls, $k, $v) { @@ -303,7 +303,7 @@ class Memcached_DataObject extends Safe_DataObject return $inst; } $key_part = Cache::keyize($cls).':'.md5($qry); - $ckey = common_cache_key($key_part); + $ckey = Cache::key($key_part); $stored = $c->get($ckey); if ($stored !== false) { @@ -550,7 +550,7 @@ class Memcached_DataObject extends Safe_DataObject $keyPart = vsprintf($format, $args); - $cacheKey = common_cache_key($keyPart); + $cacheKey = Cache::key($keyPart); return $c->delete($cacheKey); } @@ -592,7 +592,7 @@ class Memcached_DataObject extends Safe_DataObject return false; } - $cacheKey = common_cache_key($keyPart); + $cacheKey = Cache::key($keyPart); return $c->get($cacheKey); } @@ -605,7 +605,7 @@ class Memcached_DataObject extends Safe_DataObject return false; } - $cacheKey = common_cache_key($keyPart); + $cacheKey = Cache::key($keyPart); return $c->set($cacheKey, $value, $flag, $expiry); } diff --git a/classes/Notice.php b/classes/Notice.php index 7ca160509..e3d1e85cb 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -759,7 +759,7 @@ class Notice extends Memcached_DataObject $c = self::memcache(); if (!empty($c)) { - $ni = $c->get(common_cache_key('notice:who_gets:'.$this->id)); + $ni = $c->get(Cache::key('notice:who_gets:'.$this->id)); if ($ni !== false) { return $ni; } @@ -811,7 +811,7 @@ class Notice extends Memcached_DataObject if (!empty($c)) { // XXX: pack this data better - $c->set(common_cache_key('notice:who_gets:'.$this->id), $ni); + $c->set(Cache::key('notice:who_gets:'.$this->id), $ni); } return $ni; @@ -1595,7 +1595,7 @@ class Notice extends Memcached_DataObject $max_id))); } - $idkey = common_cache_key($cachekey); + $idkey = Cache::key($cachekey); $idstr = $cache->get($idkey); @@ -1782,12 +1782,12 @@ class Notice extends Memcached_DataObject if (empty($cache)) { $ids = $this->_repeatStreamDirect($limit); } else { - $idstr = $cache->get(common_cache_key('notice:repeats:'.$this->id)); + $idstr = $cache->get(Cache::key('notice:repeats:'.$this->id)); if ($idstr !== false) { $ids = explode(',', $idstr); } else { $ids = $this->_repeatStreamDirect(100); - $cache->set(common_cache_key('notice:repeats:'.$this->id), implode(',', $ids)); + $cache->set(Cache::key('notice:repeats:'.$this->id), implode(',', $ids)); } if ($limit < 100) { // We do a max of 100, so slice down to limit diff --git a/classes/Profile.php b/classes/Profile.php index 19564408c..230b3aa3a 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -432,7 +432,7 @@ class Profile extends Memcached_DataObject $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; } @@ -446,7 +446,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; @@ -456,7 +456,7 @@ class Profile extends Memcached_DataObject { $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; } @@ -468,7 +468,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; @@ -478,7 +478,7 @@ class Profile extends Memcached_DataObject { $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; } @@ -489,7 +489,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; @@ -500,7 +500,7 @@ class Profile extends Memcached_DataObject $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; } @@ -511,7 +511,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; @@ -521,7 +521,7 @@ class Profile extends Memcached_DataObject { $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)); } } @@ -529,7 +529,7 @@ class Profile extends Memcached_DataObject { $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)); } } @@ -537,7 +537,7 @@ class Profile extends Memcached_DataObject { $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)); } } @@ -545,7 +545,7 @@ class Profile extends Memcached_DataObject { $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)); } } diff --git a/classes/User.php b/classes/User.php index 36db22612..c15ddc9dc 100644 --- a/classes/User.php +++ b/classes/User.php @@ -491,10 +491,10 @@ class User extends Memcached_DataObject 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')); } $profile = $this->getProfile(); $profile->blowFaveCount(); |