Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Load base config first, then environment's config

  • Loading branch information...
commit 66c982e8fa8fb0261394b63b25a3817503263d17 1 parent fff6c2a
@thanpolas authored
Showing with 9 additions and 9 deletions.
  1. +9 −9 system/core/Common.php
View
18 system/core/Common.php
@@ -231,21 +231,21 @@ function &get_config($replace = array())
return $_config[0];
}
- // Is the config file in the environment folder?
- if ( ! defined('ENVIRONMENT') OR ! file_exists($file_path = APPPATH.'config/'.ENVIRONMENT.'/config.php'))
- {
- $file_path = APPPATH.'config/config.php';
+ $file_path = APPPATH.'config/config.php';
+ $found = false;
+ if (file_exists($file_path)) {
+ $found = true;
+ require($file_path);
}
- // Fetch the config file
- if ( ! file_exists($file_path))
+ // Is the config file in the environment folder?
+ if (defined(ENVIRONMENT) && file_exists($file_path = APPPATH.'config/'.ENVIRONMENT.'/config.php'))
{
- set_status_header(503);
+ require($file_path);
+ } else if (!$found) {
exit('The configuration file does not exist.');
}
- require($file_path);
-
// Does the $config array exist in the file?
if ( ! isset($config) OR ! is_array($config))
{

1 comment on commit 66c982e

@alexbilbie

Sorry to be anal, can you make sure your code follows the coding standard; braces should be on new lines and there should be a space either side of a bang

Please sign in to comment.
Something went wrong with that request. Please try again.