version 0.8.0
This commit is contained in:
parent
f22007003a
commit
e5ca9ef194
95 changed files with 5601 additions and 4042 deletions
28
app/Core/Config.php
Normal file
28
app/Core/Config.php
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Zentrale Konfiguration. Lädt das Array aus /config/config.php
|
||||
* (liegt außerhalb des Webroots) und stellt es global bereit.
|
||||
*/
|
||||
final class Config
|
||||
{
|
||||
/** @var array<string,mixed> */
|
||||
private static array $data = [];
|
||||
|
||||
public static function load(string $file): void
|
||||
{
|
||||
self::$data = require $file;
|
||||
}
|
||||
|
||||
public static function get(string $key, mixed $default = null): mixed
|
||||
{
|
||||
return self::$data[$key] ?? $default;
|
||||
}
|
||||
|
||||
/** @return array<string,mixed> */
|
||||
public static function all(): array
|
||||
{
|
||||
return self::$data;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue