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
2022-04-13 19:22:21 +00:00

25 lines
467 B
PHP

<?php
namespace App\Core;
use \InvalidArgumentException;
/**
* TODO: this should validate the config and stuffs
*/
class Config
{
/**
* Should hold the validated config array
*/
public array $config;
public function __construct(string $path)
{
if (!file_exists($path))
{
throw new InvalidArgumentException("Could not find configuration file: $path");
}
$this->config = require $path;
}
}