$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);
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();
}
}
$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);
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));
}
}
$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;
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)) {
{
$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 {