5 define("APP_ENVIRONMENT", getenv("APP_ENVIRONMENT") ?
: "localhost");
7 $injector->share(Config
::class)
8 ->define(Config
::class, [
9 "+array" => function($key, $injector) {
10 $settings = parse_ini_file(__DIR__
."/../../config/app.ini", true);
12 throw new \
Exception("Could not parse settings");
16 ":section" => APP_ENVIRONMENT
18 ->prepare(Config
::class, function($config, $injector) {
19 $credentials = parse_ini_file(__DIR__
."/../../config/credentials.ini", true);
21 throw new \
Exception("Could not parse credentials");
23 $config->addConfig(new Config($credentials, APP_ENVIRONMENT
));