summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-09-06 10:03:51 -0400
committerEvan Prodromou <evan@status.net>2010-09-06 10:03:51 -0400
commite42d2124a319e72f949fa354cc75252f32a5a6c5 (patch)
treecab688c9121c74f81e9edc17d85b19e209665d98
parentc2de44a53042a30a1bf8e7e9384d2641c2004313 (diff)
common_keyize() -> Cache::keyize()
-rw-r--r--classes/Memcached_DataObject.php2
-rw-r--r--classes/Notice.php8
-rw-r--r--classes/Notice_tag.php6
-rw-r--r--lib/cache.php2
-rw-r--r--lib/util.php5
-rw-r--r--plugins/GeonamesPlugin.php2
6 files changed, 10 insertions, 15 deletions
diff --git a/classes/Memcached_DataObject.php b/classes/Memcached_DataObject.php
index 0c46ef2b4..1c5245b7a 100644
--- a/classes/Memcached_DataObject.php
+++ b/classes/Memcached_DataObject.php
@@ -302,7 +302,7 @@ class Memcached_DataObject extends Safe_DataObject
$inst->query($qry);
return $inst;
}
- $key_part = common_keyize($cls).':'.md5($qry);
+ $key_part = Cache::keyize($cls).':'.md5($qry);
$ckey = common_cache_key($key_part);
$stored = $c->get($ckey);
diff --git a/classes/Notice.php b/classes/Notice.php
index 066e7a584..7ca160509 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -1941,10 +1941,10 @@ class Notice extends Memcached_DataObject
if ($tag->find()) {
while ($tag->fetch()) {
- self::blow('profile:notice_ids_tagged:%d:%s', $this->profile_id, common_keyize($tag->tag));
- self::blow('profile:notice_ids_tagged:%d:%s;last', $this->profile_id, common_keyize($tag->tag));
- self::blow('notice_tag:notice_ids:%s', common_keyize($tag->tag));
- self::blow('notice_tag:notice_ids:%s;last', common_keyize($tag->tag));
+ self::blow('profile:notice_ids_tagged:%d:%s', $this->profile_id, Cache::keyize($tag->tag));
+ self::blow('profile:notice_ids_tagged:%d:%s;last', $this->profile_id, Cache::keyize($tag->tag));
+ self::blow('notice_tag:notice_ids:%s', Cache::keyize($tag->tag));
+ self::blow('notice_tag:notice_ids:%s;last', Cache::keyize($tag->tag));
$tag->delete();
}
}
diff --git a/classes/Notice_tag.php b/classes/Notice_tag.php
index a5d0716a7..9ade36c34 100644
--- a/classes/Notice_tag.php
+++ b/classes/Notice_tag.php
@@ -40,7 +40,7 @@ class Notice_tag extends Memcached_DataObject
$ids = Notice::stream(array('Notice_tag', '_streamDirect'),
array($tag),
- 'notice_tag:notice_ids:' . common_keyize($tag),
+ 'notice_tag:notice_ids:' . Cache::keyize($tag),
$offset, $limit);
return Notice::getStreamByIds($ids);
@@ -82,9 +82,9 @@ class Notice_tag extends Memcached_DataObject
function blowCache($blowLast=false)
{
- self::blow('notice_tag:notice_ids:%s', common_keyize($this->tag));
+ self::blow('notice_tag:notice_ids:%s', Cache::keyize($this->tag));
if ($blowLast) {
- self::blow('notice_tag:notice_ids:%s;last', common_keyize($this->tag));
+ self::blow('notice_tag:notice_ids:%s;last', Cache::keyize($this->tag));
}
}
diff --git a/lib/cache.php b/lib/cache.php
index c09a1dd9f..17cc5f047 100644
--- a/lib/cache.php
+++ b/lib/cache.php
@@ -83,7 +83,7 @@ class Cache
$base_key = common_config('cache', 'base');
if (empty($base_key)) {
- $base_key = common_keyize(common_config('site', 'name'));
+ $base_key = self::keyize(common_config('site', 'name'));
}
return 'statusnet:' . $base_key . ':' . $extra;
diff --git a/lib/util.php b/lib/util.php
index a5e29a781..f1ca009b4 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -1798,11 +1798,6 @@ function common_cache_key($extra)
return Cache::key($extra);
}
-function common_keyize($str)
-{
- return Cache::keyize($str);
-}
-
function common_license_terms($uri)
{
if(preg_match('/creativecommons.org\/licenses\/([^\/]+)/', $uri, $matches)) {
diff --git a/plugins/GeonamesPlugin.php b/plugins/GeonamesPlugin.php
index c81fb4677..dd882715b 100644
--- a/plugins/GeonamesPlugin.php
+++ b/plugins/GeonamesPlugin.php
@@ -416,7 +416,7 @@ class GeonamesPlugin extends Plugin
{
$key = 'geonames:' .
implode(',', array_keys($attrs)) . ':'.
- common_keyize(implode(',', array_values($attrs)));
+ Cache::keyize(implode(',', array_values($attrs)));
if ($this->cachePrefix) {
return $this->cachePrefix . ':' . $key;
} else {