summaryrefslogtreecommitdiffstats
path: root/system/database/DB.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-07-05 15:31:12 +0200
committerAndrey Andreev <narf@bofh.bg>2012-07-05 15:31:12 +0200
commit92d18a7b6c46eadc9db58ca60ffce3980e2313ff (patch)
treeb0a869a5312279d65c3e920ffbf0b32344ab1d0f /system/database/DB.php
parentd66872ae5d7cd4d2b531251a9c63528e81af3322 (diff)
parent7ca36131d881d3f83a86d824263d4abd65439e12 (diff)
Merge upstream branch
Diffstat (limited to 'system/database/DB.php')
-rw-r--r--system/database/DB.php19
1 files changed, 17 insertions, 2 deletions
diff --git a/system/database/DB.php b/system/database/DB.php
index 13a447d15..d751325ce 100644
--- a/system/database/DB.php
+++ b/system/database/DB.php
@@ -29,8 +29,8 @@
* Initialize the database
*
* @category Database
- * @author EllisLab Dev Team
- * @link http://codeigniter.com/user_guide/database/
+ * @author EllisLab Dev Team
+ * @link http://codeigniter.com/user_guide/database/
* @param string
* @param bool Determines if query builder should be used or not
*/
@@ -47,6 +47,21 @@ function &DB($params = '', $query_builder_override = NULL)
}
include($file_path);
+ //make packages contain database config files
+ foreach(get_instance()->load->get_package_paths() as $path)
+ {
+ if ($path !== APPPATH)
+ {
+ if (file_exists ($file_path = $path.'config/'.ENVIRONMENT.'/database.php'))
+ {
+ include ($file_path);
+ }
+ elseif ( file_exists ($file_path = $path.'config/database.php'))
+ {
+ include ($file_path);
+ }
+ }
+ }
if ( ! isset($db) OR count($db) === 0)
{