X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=app%2Fbootstrap%2Fconfig.php;h=e4d47729b32f92647456fd55aa632238280cdec5;hb=2f593903bb0b095e3ecaece6c8e73ab3410af64f;hp=3bc7f910667144c4c91f37c9d140cc57e5d05376;hpb=26494fb5cdfb9cf103904d10b6bda564bcf2d0bd;p=pharext%2Fpharext.org diff --git a/app/bootstrap/config.php b/app/bootstrap/config.php index 3bc7f91..e4d4772 100644 --- a/app/bootstrap/config.php +++ b/app/bootstrap/config.php @@ -7,11 +7,18 @@ define("APP_ENVIRONMENT", getenv("APP_ENVIRONMENT") ?: "localhost"); $injector->share(Config::class) ->define(Config::class, [ "+array" => function($key, $injector) { - return parse_ini_file(__DIR__."/../../config/app.ini", true); + $settings = parse_ini_file(__DIR__."/../../config/app.ini", true); + if (!$settings) { + throw new \Exception("Could not parse settings"); + } + return $settings; }, ":section" => APP_ENVIRONMENT ]) ->prepare(Config::class, function($config, $injector) { $credentials = parse_ini_file(__DIR__."/../../config/credentials.ini", true); + if (!$credentials) { + throw new \Exception("Could not parse credentials"); + } $config->addConfig(new Config($credentials, APP_ENVIRONMENT)); });