From: Jan Schneider Date: Thu, 11 Nov 2010 14:19:55 +0000 (+0100) Subject: This is supposed to fix the adapter not being available in the schema X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=905fc88ad103f265cdbd9d7df1030a2ee62e4224;p=horde.git This is supposed to fix the adapter not being available in the schema object when unserializing adapters. But it makes my PHP segfault at the moment. :-( --- diff --git a/framework/Db/lib/Horde/Db/Adapter/Base.php b/framework/Db/lib/Horde/Db/Adapter/Base.php index e8b694366..6eac0086b 100644 --- a/framework/Db/lib/Horde/Db/Adapter/Base.php +++ b/framework/Db/lib/Horde/Db/Adapter/Base.php @@ -157,6 +157,7 @@ abstract class Horde_Db_Adapter_Base implements Horde_Db_Adapter */ public function __wakeup() { + $this->_schema->setAdapter($this); $this->connect(); } diff --git a/framework/Db/lib/Horde/Db/Adapter/Base/Schema.php b/framework/Db/lib/Horde/Db/Adapter/Base/Schema.php index 49ac4755b..56761854f 100644 --- a/framework/Db/lib/Horde/Db/Adapter/Base/Schema.php +++ b/framework/Db/lib/Horde/Db/Adapter/Base/Schema.php @@ -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 ##########################################################################*/