dev-master
9999999-dev http://github.com/watoki/cfgConfiguration loader
MIT
The Requires
- php >=5.3.8
- watoki/factory *
The Development Requires
configuration watoki
Wallogit.com
2017 © Pedro Peláez
Configuration loader
cfg is a simple configuration loader., (*1)
Given you have a configuration class name\space\MyAppConfiguration then you can overwrite it with a
deployment-specific configuration name\space\MyConfiguration in a file some/folder/MyConfiguration.php and load it with, (*2)
$loader = new Loader(new Factory());
$config = $loader->loadConfiguration('name\space\MyAppConfiguration', 'some/folder/MyConfiguration.php');
This will result in MyConfiguration being set as singleton for MyAppConfiguration, so whenever the latter one is
injected through the Factory, the former is used instead., (*3)
Note that MyConfiguration needs to be in the same namespace as MyAppConfiguration and the name of the containing file matches
the class name., (*4)
To use cfg in your own project with Composer, add the following lines to your composer.json., (*5)
"require" : {
"watoki/cfg" : "*"
}
Configuration loader
MIT
configuration watoki