? eacc.patch
Index: engines/eacc.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/cacherouter/engines/eacc.php,v
retrieving revision 1.1.2.10
diff -u -p -r1.1.2.10 eacc.php
--- engines/eacc.php	3 Nov 2008 20:33:50 -0000	1.1.2.10
+++ engines/eacc.php	6 Nov 2008 22:42:22 -0000
@@ -60,18 +60,12 @@ class eaccCache extends Cache {
     $cache->expire = $expire;
     $cache->headers = $headers;
 
-    if (!is_string($value)) {
-      $cache->serialized = TRUE;
-      $cache->data = serialize($value);
-    }
-    else { 
-      $cache->serialized = FALSE;
-      $cache->data = $value;
-    }
+    $cache->serialized = FALSE;
+    $cache->data = $value;
 
     if (!empty($key) && $this->lock()) {
       // Get lookup table to be able to keep track of bins
-      $lookup = eaccelerator_get($this->lookup);
+      $lookup = unserialize(eaccelerator_get($this->lookup));
 
       // If the lookup table is empty, initialize table
       if (empty($lookup)) {
@@ -82,7 +76,7 @@ class eaccCache extends Cache {
       $lookup[$this->key($key)] = 1;
 
       // Attempt to store full key and value
-      if (!eaccelerator_put($this->key($key), $cache, $expire)) {
+      if (!eaccelerator_put($this->key($key), serialize($cache), $expire)) {
         unset($lookup[$this->key($key)]);
         $return = FALSE;
       }
@@ -91,15 +85,16 @@ class eaccCache extends Cache {
         parent::set($this->key($key), $cache);
         $return = TRUE;
       }
-      
+
       // Resave the lookup table (even on failure)
-      eaccelerator_put($this->lookup, $lookup, 0);
+      eaccelerator_put($this->lookup, serialize($lookup), 0);
 
       // Remove lock.
       $this->unlock();
     }
 
     return $return;
+  }
 
   /**
    * delete()
@@ -123,7 +118,7 @@ class eaccCache extends Cache {
         if (is_array($lookup)) {
           if ($key == '*') {
             //Fast clean of lookup
-            eaccelerator_put($this->lookup, array());
+            eaccelerator_put($this->lookup, serialize(array()));
             $this->unlock();
             foreach ($lookup as $k => $v) {
               eaccelerator_rm($k);
@@ -222,4 +217,23 @@ class eaccCache extends Cache {
   function unlock() {
     return  eaccelerator_unlock($this->lock);
   }
+
+  function stats() {
+    $eacc_stats = eaccelerator_info();
+    $stats = array(
+      'uptime' => time(),
+      'bytes_used' => $eacc_stats['memoryAllocated'],
+      'bytes_total' => $eacc_stats['memorySize'],
+      'gets' => 0,
+      'sets' => 0,
+      'hits' => 0,
+      'misses' => 0,
+      'req_rate' => 0,
+      'hit_rate' => 0,
+      'miss_rate' => 0,
+      'set_rate' => 0,
+    );
+    return $stats;
+  }
+
 }
