summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGints Murans <gm@gm.lv>2012-05-22 23:21:39 +0200
committerGints Murans <gm@gm.lv>2012-05-22 23:21:39 +0200
commitab396b4a56d3eaa91c559ccc4df2817c53897aef (patch)
treedcc25c5207edde43d364cc5b7d7aa77538c27f3f
parent36237d8305260282b46f52f9fec91b5b7176088f (diff)
Moved destruct to the end of file
-rw-r--r--system/database/DB_driver.php24
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 */