+ /**
+ * Build a representation for an object for logging
+ * @param mixed
+ * @return string
+ */
+ function logrep($object) {
+ if (is_object($object)) {
+ $class = get_class($object);
+ if (isset($object->id)) {
+ return "$class $object->id";
+ }
+ return $class;
+ }
+ if (is_string($object)) {
+ $len = strlen($object);
+ $fragment = mb_substr($object, 0, 32);
+ if (mb_strlen($object) > 32) {
+ $fragment .= '...';
+ }
+ return "string '$fragment' ($len bytes)";
+ }
+ return strval($object);
+ }
+
+ /**
+ * Encode an object for queued storage.
+ *
+ * @param mixed $item
+ * @return string
+ */
+ protected function encode($item)
+ {
+ return serialize($item);
+ }
+
+ /**
+ * Decode an object from queued storage.
+ * Accepts notice reference entries and serialized items.
+ *
+ * @param string
+ * @return mixed
+ */
+ protected function decode($frame)
+ {
+ return unserialize($frame);
+ }
+