22 lines
388 B
PHP
Executable File
22 lines
388 B
PHP
Executable File
<?php
|
|
|
|
class Config {
|
|
private static $config = null;
|
|
|
|
private function __construct() {
|
|
}
|
|
|
|
public static function get(string $val, mixed $default = null) : mixed {
|
|
if (Config::$config == null) {
|
|
Config::$config = parse_ini_file(__DIR__ . "/../.env");
|
|
}
|
|
if (array_key_exists($val, Config::$config)) {
|
|
return Config::$config[$val];
|
|
} else {
|
|
return $default;
|
|
}
|
|
}
|
|
|
|
}
|
|
|