]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Status_network_tag.php
Catch missing profile in realtime server
[quix0rs-gnu-social.git] / classes / Status_network_tag.php
index a5893c114181aa1c724d701841ed21f963c0fa1a..4a7c3b51ff15311a903f1ce4d303d80a32e4defa 100644 (file)
@@ -43,7 +43,6 @@ class Status_network_tag extends Safe_DataObject
         $this->_connect();
     }
 
-
     /* Static get */
     function staticGet($k,$v=null)
     {
@@ -99,7 +98,7 @@ class Status_network_tag extends Safe_DataObject
 
         if (Status_network::$cache) {
             $packed = implode('|', $result);
-            Status_network::$cache->set($key, $packed, 3600);
+            Status_network::$cache->set($key, $packed, 0, 3600);
         }
 
         return $result;
@@ -112,8 +111,10 @@ class Status_network_tag extends Safe_DataObject
     function decache()
     {
         $key = 'status_network_tags:' . $this->site_id;
-        if (Status_network::$cache) {
-            Status_network::$cache->delete($key);
+        if (Status_network::$cache || Status_network::$cacheInitialized) {
+            // FIXME: this was causing errors, so I'm hiding them.
+            // I'm a big chicken and lazy.
+            @Status_network::$cache->delete($key);
         }
     }
 
@@ -130,4 +131,15 @@ class Status_network_tag extends Safe_DataObject
         $this->decache();
         return $ret;
     }
+
+    static function withTag($tag)
+    {
+        $snt = new Status_network_tag();
+
+        $snt->tag = $tag;
+
+        $snt->find();
+
+        return $snt;
+    }
 }