summaryrefslogtreecommitdiffstats
path: root/system/database
diff options
context:
space:
mode:
authorPhil Sturgeon <email@philsturgeon.co.uk>2011-04-06 23:57:43 +0200
committerPhil Sturgeon <email@philsturgeon.co.uk>2011-04-06 23:57:43 +0200
commit05fa61144667c85b0463f7e8baa6af00aa195dc6 (patch)
tree2a611231c945ce7fd5bd021e3491dd973794f58e /system/database
parent08b5169a5181706156c9a53229d164d9fa3aea32 (diff)
Made Environment Support optional. Comment out or delete the constant to stop environment checks.
Diffstat (limited to 'system/database')
-rw-r--r--system/database/DB.php13
1 files changed, 4 insertions, 9 deletions
diff --git a/system/database/DB.php b/system/database/DB.php
index 93ee3922a..8bf1ba8ba 100644
--- a/system/database/DB.php
+++ b/system/database/DB.php
@@ -27,17 +27,12 @@ function &DB($params = '', $active_record_override = NULL)
// Load the DB config file if a DSN string wasn't passed
if (is_string($params) AND strpos($params, '://') === FALSE)
{
-
- $file_path = APPPATH.'config/'.ENVIRONMENT.'/database'.EXT;
-
- if ( ! file_exists($file_path))
+ // Is the config file in the environment folder?
+ if ( ! defined('ENVIRONMENT') OR ! file_exists($file_path = APPPATH.'config/'.ENVIRONMENT.'/database'.EXT))
{
- log_message('debug', 'Database config for '.ENVIRONMENT.' environment is not found. Trying global config.');
- $file_path = APPPATH.'config/database'.EXT;
-
- if ( ! file_exists($file_path))
+ if ( ! file_exists($file_path = APPPATH.'config/database'.EXT))
{
- continue;
+ show_error('The configuration file database'.EXT.' does not exist.');
}
}