]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Store serialized representations of queue items in the queue
authorCraig Andrews <candrews@integralblue.com>
Fri, 22 Jan 2010 22:55:26 +0000 (17:55 -0500)
committerCraig Andrews <candrews@integralblue.com>
Fri, 22 Jan 2010 22:55:26 +0000 (17:55 -0500)
lib/queuemanager.php

index 4eb39bfa8c72ecf75ef76630244b3a513fe42a97..8921b02cc80d69a54c4b07b12c72775e1bdd4427 100644 (file)
@@ -139,20 +139,13 @@ abstract class QueueManager extends IoManager
 
     /**
      * Encode an object for queued storage.
-     * Next gen may use serialization.
      *
      * @param mixed $object
      * @return string
      */
     protected function encode($object)
     {
-        if ($object instanceof Notice) {
-            return $object->id;
-        } else if (is_string($object)) {
-            return $object;
-        } else {
-            throw new ServerException("Can't queue this type", 500);
-        }
+        return serialize($object);
     }
 
     /**
@@ -164,11 +157,7 @@ abstract class QueueManager extends IoManager
      */
     protected function decode($frame)
     {
-        if (is_numeric($frame)) {
-            return Notice::staticGet(intval($frame));
-        } else {
-            return $frame;
-        }
+        return unserialize($frame);
     }
 
     /**