summaryrefslogtreecommitdiff
path: root/framework/DataAccess/TAdodbProvider.php
diff options
context:
space:
mode:
Diffstat (limited to 'framework/DataAccess/TAdodbProvider.php')
-rw-r--r--framework/DataAccess/TAdodbProvider.php33
1 files changed, 17 insertions, 16 deletions
diff --git a/framework/DataAccess/TAdodbProvider.php b/framework/DataAccess/TAdodbProvider.php
index 65e336a9..53eead61 100644
--- a/framework/DataAccess/TAdodbProvider.php
+++ b/framework/DataAccess/TAdodbProvider.php
@@ -35,7 +35,7 @@ class TAdodbProvider extends TDatabaseProvider
public function getConnection()
{
- if(is_null($this->_connection))
+ if(is_null($this->_connection) || is_null($this->_connection->getProvider()))
{
$this->importAdodbLibrary();
$this->_connection = new TAdodbConnection($this);
@@ -148,28 +148,15 @@ class TAdodbConnection extends TDbConnection
}
/**
- * PHP magic function.
- * This method will pass all method calls to ADOConnection class
- * provided in the ADODB library.
- * @param mixed method name
- * @param mixed method call parameters
- * @param mixed return value of the method call
- */
- public function __call($method, $params)
- {
- if(is_null($this->_connection) || !$this->_connection->IsConnected())
- $this->open();
- return call_user_func_array(array($this->_connection,$method),$params);
- }
-
- /**
* Cleanup work before serializing.
* This is a PHP defined magic method.
* @return array the names of instance-variables to serialize.
*/
public function __sleep()
{
+ //close any open connections before serializing.
$this->close();
+ $this->_connection = null;
return array_keys(get_object_vars($this));
}
@@ -181,6 +168,20 @@ class TAdodbConnection extends TDbConnection
{
}
+ /**
+ * PHP magic function.
+ * This method will pass all method calls to ADOConnection class
+ * provided in the ADODB library.
+ * @param mixed method name
+ * @param mixed method call parameters
+ * @param mixed return value of the method call
+ */
+ public function __call($method, $params)
+ {
+ if(is_null($this->_connection) || !$this->_connection->IsConnected())
+ $this->open();
+ return call_user_func_array(array($this->_connection,$method),$params);
+ }
public function getIsClosed()
{