From f5a8530cc937d193aa928bc25f2970eae772d6ef Mon Sep 17 00:00:00 2001 From: Rene Brokholm Date: Thu, 5 Jul 2012 09:05:32 +0200 Subject: code cleanup and changelog added --- system/database/DB.php | 26 +++++++++++++------------- user_guide_src/source/changelog.rst | 1 + 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/system/database/DB.php b/system/database/DB.php index fd5cf5516..3044ce517 100644 --- a/system/database/DB.php +++ b/system/database/DB.php @@ -49,19 +49,19 @@ 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 ($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) { diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index e5c46ff93..9a7cec320 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -137,6 +137,7 @@ Release Date: Not Released - Added PDO support for create_database(), drop_database and drop_table() in :doc:`Database Forge `. - Added unbuffered_row() method for getting a row without prefetching whole result (consume less memory). - Added PDO support for ``list_fields()`` in :doc:`Database Results `. + - Added capability for packages to hold database.php config files - Libraries -- cgit v1.2.3-24-g4f1b