diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-07-05 09:39:04 +0200 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-07-05 09:39:04 +0200 |
commit | 57570068139ba1e93d81b54b8d6e006cd107257f (patch) | |
tree | 3ea2f4357a45e6eb52d3014c1789b2fd4a9349ec /system/database | |
parent | 91cb3176dbcd1a34e7d99c6dce355e555be8c93a (diff) | |
parent | f5a8530cc937d193aa928bc25f2970eae772d6ef (diff) |
Merge pull request #1577 from rebizu/develop
I added so the DB.php is aware of database config files in packages.
Diffstat (limited to 'system/database')
-rw-r--r-- | system/database/DB.php | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/system/database/DB.php b/system/database/DB.php index 00d14b43e..3044ce517 100644 --- a/system/database/DB.php +++ b/system/database/DB.php @@ -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) { @@ -166,4 +181,4 @@ function &DB($params = '', $query_builder_override = NULL) } /* End of file DB.php */ -/* Location: ./system/database/DB.php */
\ No newline at end of file +/* Location: ./system/database/DB.php */ |