Welcome Guest, Not a member yet? Register   Sign In
What the logic behind config files being classes?

I noticed the configuration files are being switched from arrays to actual classes (of course I realize nothing is in stone yet)

What is the logic behind this and will we still be able to override certain values with new values in environmental config "folders"?

For example in /config/application.php I could have
$config['show full name'] = true;
$config['show login'] = true;

In /config/production/application.php I override just the one value
$config['show full name'] = false;

Currently it loads /config/application.php and merges /config/production/application.php over it that way I get all the settings in a single array.

I extended MY_Loader to add a "database" config layer to override the other 2 as needed as well as manage this with CodeIgniter's cache system which allows me to make a single call to cache the entire (all 3 layers & all config files) merged config array and one call to get everything out (no need to load file after file after file...).

Do you think this will still be do able and just as fast as the array method as well as cacheable?
I can't image making everything a object will actually be faster and just as flexible but, I could be wrong?


Messages In This Thread
What the logic behind config files being classes? - by dmyers - 04-20-2016, 05:07 PM

Theme © iAndrew 2016 - Forum software by © MyBB