summaryrefslogtreecommitdiff
path: root/framework/DataAccess/TAdodbProvider.php
diff options
context:
space:
mode:
authorwei <>2006-03-12 10:38:37 +0000
committerwei <>2006-03-12 10:38:37 +0000
commit5f66433898f89865a6682ad9aebfeef14b596dea (patch)
treef6c054b431018497493d0380e4ee989597ea2b19 /framework/DataAccess/TAdodbProvider.php
parent18193d8eff4e5bcb31ade4d3b0747e1aa5e9bf77 (diff)
adding TSQLMap module
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()
{