From: Chuck Hagenbuch Date: Tue, 25 Jan 2011 14:04:59 +0000 (-0500) Subject: Don't consider the connection active if the connection object is missing/false, and... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=86a3abf06cb476637e25b8612c7424fa600f44de;p=horde.git Don't consider the connection active if the connection object is missing/false, and try reconnecting if the connection isn't active when execute() is called --- diff --git a/framework/Db/lib/Horde/Db/Adapter/Base.php b/framework/Db/lib/Horde/Db/Adapter/Base.php index 608e8940b..a34247ed7 100644 --- a/framework/Db/lib/Horde/Db/Adapter/Base.php +++ b/framework/Db/lib/Horde/Db/Adapter/Base.php @@ -332,7 +332,7 @@ abstract class Horde_Db_Adapter_Base implements Horde_Db_Adapter */ public function isActive() { - return $this->_active; + return $this->_active && $this->_connection; } /** @@ -517,6 +517,8 @@ abstract class Horde_Db_Adapter_Base implements Horde_Db_Adapter */ public function execute($sql, $arg1 = null, $arg2 = null) { + if (!$this->isActive()) { $this->reconnect(); } + if (is_array($arg1)) { $sql = $this->_replaceParameters($sql, $arg1); $name = $arg2;