Skip to content

Commit

Permalink
Backport CI_Config::load() optimization from pull #1571
Browse files Browse the repository at this point in the history
  • Loading branch information
narfbg committed Jul 4, 2012
1 parent bd0b4b3 commit a8126b1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions system/core/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@ function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE)
$found = FALSE;
$loaded = FALSE;

$check_locations = defined('ENVIRONMENT')
? array(ENVIRONMENT.'/'.$file, $file)
: array($file);

foreach ($this->_config_paths as $path)
{
$check_locations = defined('ENVIRONMENT')
? array(ENVIRONMENT.'/'.$file, $file)
: array($file);

foreach ($check_locations as $location)
{
$file_path = $path.'config/'.$location.'.php';
Expand Down Expand Up @@ -168,7 +168,7 @@ function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE)
{
return FALSE;
}
show_error('The configuration file '.$file.'.php'.' does not exist.');
show_error('The configuration file '.$file.'.php does not exist.');
}

return TRUE;
Expand Down Expand Up @@ -279,7 +279,7 @@ function site_url($uri = '')
*/
function base_url($uri = '')
{
return $this->slash_item('base_url').ltrim($this->_uri_string($uri),'/');
return $this->slash_item('base_url').ltrim($this->_uri_string($uri), '/');
}

// -------------------------------------------------------------
Expand Down

0 comments on commit a8126b1

Please sign in to comment.