Index: xcache.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/authcache/engines/xcache.php,v
retrieving revision 1.3
diff -u -p -r1.3 xcache.php
--- xcache.php	13 Jul 2009 02:55:01 -0000	1.3
+++ xcache.php	20 Aug 2009 03:25:50 -0000
@@ -32,7 +32,16 @@ class xcacheCache extends Cache {
     }
 
     // Get item from cache
-    $cache = xcache_get($this->key($key));
+    $arr_cache = xcache_get($this->key($key));
+    
+    if ($arr_cache){
+      // Cache object is in xcache as array, cast it to object for Drupal use.
+      $cache = (object)$arr_cache;
+      if ($cache->serialized){
+        // unserialize cache data so it can be used
+        $cache->data = unserialize($cache->data);
+      }
+    }
 
     // Update static cache
     parent::set($this->key($key), $cache);
@@ -88,7 +97,7 @@ class xcacheCache extends Cache {
       $lookup[$this->key($key)] = $expire;
 
       // Attempt to store full key and value
-      if (!xcache_set($this->key($key), $cache, $expire)) {
+      if (!xcache_set($this->key($key), (array)$cache, $expire)) {
         unset($lookup[$this->key($key)]);
         $return = FALSE;
       }
@@ -218,4 +227,4 @@ class xcacheCache extends Cache {
   function unlock() {
     return xcache_unset($this->lock);
   }
-}
\ No newline at end of file
+}
