From ab396b4a56d3eaa91c559ccc4df2817c53897aef Mon Sep 17 00:00:00 2001 From: Gints Murans Date: Wed, 23 May 2012 00:21:39 +0300 Subject: Moved destruct to the end of file --- system/database/DB_driver.php | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'system/database/DB_driver.php') 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 */ -- cgit v1.2.3-24-g4f1b