This repository has been archived on 2023-01-06. You can view files and clone it, but cannot push or open issues or pull requests.
web/app/lib/App/Core/Config.php

25 lines
441 B
PHP
Raw Normal View History

2022-01-24 07:38:51 +00:00
<?php
2022-03-02 06:15:12 +00:00
namespace App\Core;
use \Exception;
/**
* TODO: ... this should validate the config and stuffs
*/
2022-01-24 07:38:51 +00:00
class Config
{
2022-03-02 06:15:12 +00:00
/**
* Should hold the validated config array
*/
2022-01-24 07:38:51 +00:00
public array $config;
public function __construct(string $path)
{
2022-01-24 11:55:37 +00:00
if (!file_exists($path))
{
2022-01-27 21:08:06 +00:00
throw new Exception("Could not find configuration file: $path");
2022-01-24 07:38:51 +00:00
}
$this->config = require $path;
}
}