From 905fc88ad103f265cdbd9d7df1030a2ee62e4224 Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Thu, 11 Nov 2010 15:19:55 +0100 Subject: [PATCH] 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. :-( --- framework/Db/lib/Horde/Db/Adapter/Base.php | 1 + framework/Db/lib/Horde/Db/Adapter/Base/Schema.php | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) 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 ##########################################################################*/ -- 2.11.0