summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-10-24 20:47:39 +0200
committerAndrey Andreev <narf@bofh.bg>2012-10-24 20:48:08 +0200
commit9d0ab04e1e39bc93c59f60844dd2cf9176443028 (patch)
tree91fc6c6f737676c6f80fba8d53e5b60e3ba3b5a4
parentf795ab52dadaef20afd3a97ad4c8ed408e211dc2 (diff)
Fix #191
-rw-r--r--system/core/Loader.php8
-rw-r--r--user_guide_src/source/changelog.rst1
2 files changed, 5 insertions, 4 deletions
diff --git a/system/core/Loader.php b/system/core/Loader.php
index 5de2e5dde..b316c8e1b 100644
--- a/system/core/Loader.php
+++ b/system/core/Loader.php
@@ -318,9 +318,9 @@ class CI_Loader {
/**
* Database Loader
*
- * @param string the DB credentials
- * @param bool whether to return the DB object
- * @param bool whether to enable query builder (this allows us to override the config setting)
+ * @param mixed $params = '' the DB settings
+ * @param bool $return = FALSE whether to return the DB object
+ * @param bool $query_builder = NULL whether to enable query builder (overrides the config setting)
* @return object
*/
public function database($params = '', $return = FALSE, $query_builder = NULL)
@@ -329,7 +329,7 @@ class CI_Loader {
$CI =& get_instance();
// Do we even need to load the database class?
- if (class_exists('CI_DB') && $return === FALSE && $query_builder === NULL && isset($CI->db) && is_object($CI->db))
+ if ($return === FALSE && $query_builder === NULL && isset($CI->db) && is_object($CI->db) && ! empty($CI->db->conn_id))
{
return FALSE;
}
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index 92f6a03ef..ca46e9db1 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -377,6 +377,7 @@ Bug fixes for 3.0
- Fixed a bug (#1766) - :doc:`Query Builder <database/query_builder>` didn't always take into account the *dbprefix* setting.
- Fixed a bug (#779) - :doc:`URI Class <libraries/uri>` didn't always trim slashes from the *uri_string* as shown in the documentation.
- Fixed a bug (#134) - :doc:`Database Caching <database/caching>` method ``delete_cache()`` didn't work in some cases due to *cachedir* not being initialized properly.
+- Fixed a bug (#191) - :doc:`Loader Library <libraries/loader>` ignored attempts for (re)loading databases to ``get_instance()->db`` even when the old database connection is dead.
Version 2.1.3
=============