diff options
author | Gints Murans <gm@gm.lv> | 2012-05-22 23:21:39 +0200 |
---|---|---|
committer | Gints Murans <gm@gm.lv> | 2012-05-22 23:21:39 +0200 |
commit | ab396b4a56d3eaa91c559ccc4df2817c53897aef (patch) | |
tree | dcc25c5207edde43d364cc5b7d7aa77538c27f3f /system/database/DB_driver.php | |
parent | 36237d8305260282b46f52f9fec91b5b7176088f (diff) |
Moved destruct to the end of file
Diffstat (limited to 'system/database/DB_driver.php')
-rw-r--r-- | system/database/DB_driver.php | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index c757277ce..44c864e64 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -90,13 +90,6 @@ abstract class CI_DB_driver { log_message('debug', 'Database Driver Class Initialized'); } - // -------------------------------------------------------------------- - - public function __destruct() - { - $this->close(); - } - // -------------------------------------------------------------------- /** @@ -1397,6 +1390,23 @@ abstract class CI_DB_driver { { } + // -------------------------------------------------------------------- + + /** + * Destructor + * + * Closes the database connection, if needed. + * + * @return void + */ + public function __destruct() + { + if ($this->conn_id && ! $this->pconnect) + { + $this->close(); + } + } + } /* End of file DB_driver.php */ |