]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
common_keyize() -> Cache::keyize()
authorEvan Prodromou <evan@status.net>
Mon, 6 Sep 2010 14:03:51 +0000 (10:03 -0400)
committerEvan Prodromou <evan@status.net>
Mon, 6 Sep 2010 14:03:51 +0000 (10:03 -0400)
classes/Memcached_DataObject.php
classes/Notice.php
classes/Notice_tag.php
lib/cache.php
lib/util.php
plugins/GeonamesPlugin.php

index 0c46ef2b414ee4b87f0b641b7bd9a604f1b97aed..1c5245b7a2ea98d24ffd26cd08b45ed6a0fd365c 100644 (file)
@@ -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);
 
index 066e7a584f080c27f9754dabdc8ac864320d656f..7ca160509563b7a72a6c2f3ef37c3eaa56ba1595 100644 (file)
@@ -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();
             }
         }
index a5d0716a7136d6b00c073b0679f7afe273340eb0..9ade36c34a7dfc0cdf0e8a63b548b3db6f643724 100644 (file)
@@ -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));
         }
     }
 
index c09a1dd9f27c75676eb24f634f6c0378547c798d..17cc5f0472546b73ef8bd52a895a324aeacc03a8 100644 (file)
@@ -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;
index a5e29a7818cf2e8215795205c8a42cce750b64bc..f1ca009b4eb6063fe99845238f76dc1c5a827418 100644 (file)
@@ -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)) {
index c81fb46771573152067f0e67d265aa41557b6960..dd882715ba6406cfd2827a509c49ecb2f72a4834 100644 (file)
@@ -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 {