Non puoi selezionare più di 25 argomenti
Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
30 righe
706 B
30 righe
706 B
<?php |
|
|
|
namespace MwgAuth\Core; |
|
|
|
class Config |
|
{ |
|
private static $config = []; |
|
|
|
private static function load(): void |
|
{ |
|
if (empty(self::$config)) { |
|
foreach (glob(dirname(__DIR__) . '/Config/*.php') as $config) { |
|
$section = pathinfo($config, PATHINFO_FILENAME); |
|
self::$config[$section] = include($config); |
|
} |
|
} |
|
} |
|
|
|
public static function getSection(string $section): array |
|
{ |
|
self::load(); |
|
return self::$config[$section] ?? []; |
|
} |
|
|
|
public static function getValue(string $section, string $name): ?string |
|
{ |
|
self::load(); |
|
return self::$config[$section][$name] ?? null; |
|
} |
|
}
|
|
|