• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Core Config load warnings after it finds config file

I'm using the latest release of CI 2.0.2.

I have a situation where I am trying to manually load a config file from code that I setup as a package using $autoload['packages'] = 'package_path/config/myconfig.php'. When I call $this->CI->config->load('myconfig', TRUE, TRUE) I get the config object back as expected, however, I also get php warnings that other paths for the config file are not found.

After reviewing the /system/core/config.php code, it appears that after the file is found the loop variable $loaded is set to TRUE but the code continues in the loop without breaking out causing it to check other paths in the _config_paths array. Additionally, the loop variable $loaded is set to TRUE from when it found the file but is not reset to FALSE before it continues back in the loop which is causing the warning messages to occur.

The simple fix I made was to put a break; on line 148, however since this is core code I thought I would put this out there to get some feedback from the CI team as to whether this is a bug or something I am missing about the intended behavior of the logic.

config files have to go in the config folder and if called from a library has to have the same names!


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.