This is supposed to fix the adapter not being available in the schema
authorJan Schneider <jan@horde.org>
Thu, 11 Nov 2010 14:19:55 +0000 (15:19 +0100)
committerJan Schneider <jan@horde.org>
Thu, 11 Nov 2010 14:19:55 +0000 (15:19 +0100)
object when unserializing adapters. But it makes my PHP segfault at
the moment. :-(

framework/Db/lib/Horde/Db/Adapter/Base.php
framework/Db/lib/Horde/Db/Adapter/Base/Schema.php

index e8b6943..6eac008 100644 (file)
@@ -157,6 +157,7 @@ abstract class Horde_Db_Adapter_Base implements Horde_Db_Adapter
      */
     public function __wakeup()
     {
+        $this->_schema->setAdapter($this);
         $this->connect();
     }
 
index 49ac475..5676185 100644 (file)
@@ -42,13 +42,20 @@ abstract class Horde_Db_Adapter_Base_Schema
      * @param Horde_Db_Adapter_Base $adapter
      * @param array $config
      */
-    public function __construct($adapter, $config = array())
+    public function __construct(Horde_Db_Adapter $adapter, $config = array())
+    {
+        $this->setAdapter($adapter);
+    }
+
+    /**
+     * @param Horde_Db_Adapter $adapter
+     */
+    public function setAdapter(Horde_Db_Adapter $adapter)
     {
         $this->_adapter = $adapter;
         $this->_adapterMethods = array_flip(get_class_methods($adapter));
     }
 
-
     /*##########################################################################
     # Object factories
     ##########################################################################*/