diff --git a/src/Service/Config.php b/src/Service/Config.php index d750d36..e7d4273 100644 --- a/src/Service/Config.php +++ b/src/Service/Config.php @@ -1,4 +1,11 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + */ namespace App\Service; @@ -11,23 +18,21 @@ class Config { private array $config; - /** - * @throws Exception - */ public function __construct() { + // Check for either config.json.local or config.json. $configFile = dirname(path: __DIR__, levels: 2) . "/config.json.local"; if (!file_exists(filename: $configFile)) { $configFile = dirname(path: __DIR__, levels: 2) . "/config.json"; } if (!file_exists(filename: $configFile)) { - throw new Exception(message: 'Missing config file'); + die('Missing config file'); } $configJSON = file_get_contents(filename: $configFile); if (json_decode(json: $configJSON) === null) { - throw new Exception(message: 'Config file is not valid JSON.'); + die('Config file is not valid JSON.'); } $this->config = json_decode(json: $configJSON, associative: true);