Add __wakeup() call to Horde_Memcache
authorMichael M Slusarz <slusarz@curecanti.org>
Sat, 30 Jan 2010 22:48:47 +0000 (15:48 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Sun, 31 Jan 2010 04:15:12 +0000 (21:15 -0700)
framework/Memcache/lib/Horde/Memcache.php

index 920f407..5b2daa5 100644 (file)
@@ -107,6 +107,8 @@ class Horde_Memcache
 
     /**
      * Constructor.
+     *
+     * @throws Horde_Exception
      */
     protected function __construct()
     {
@@ -114,6 +116,16 @@ class Horde_Memcache
         $this->_params['prefix'] = (empty($this->_params['prefix'])) ? 'horde' : $this->_params['prefix'];
         $this->_large = !empty($this->_params['large_items']);
 
+        $this->__wakeup();
+    }
+
+    /**
+     * Do re-initialization on unserialize().
+     *
+     * @throws Horde_Exception
+     */
+    public function __wakeup()
+    {
         $servers = array();
         $this->_memcache = new Memcache;
         for ($i = 0, $n = count($this->_params['hostspec']); $i < $n; ++$i) {