You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.0 KiB
44 lines
1.0 KiB
<?php
|
|
|
|
namespace App;
|
|
|
|
use App\Common\UUID;
|
|
use App\Enumerators\Parameter;
|
|
use App\Enumerators\SessionElement;
|
|
use App\Wrappers\APIWrapper;
|
|
use SimpleXMLElement;
|
|
use Symfony\Component\Yaml\Yaml;
|
|
|
|
class Configuration
|
|
{
|
|
public static string $SecretDenominator = ";";
|
|
|
|
public static function GetConfig(string ...$nav) : string|array
|
|
{
|
|
$config = Yaml::parseFile(__DIR__ . "/../Configuration/Configuration.yaml");
|
|
|
|
$temp = $config;
|
|
foreach ($nav as $n) $temp = $temp[$n];
|
|
|
|
if(is_array($temp))
|
|
{
|
|
return $temp;
|
|
}
|
|
else
|
|
{
|
|
if(str_starts_with(haystack: $temp, needle: Configuration::$SecretDenominator))
|
|
{
|
|
$secrets = Yaml::parseFile(__DIR__ . "/../Configuration/Secrets.yaml");
|
|
return $secrets[substr($temp, 1)];
|
|
}
|
|
}
|
|
|
|
|
|
return $temp;
|
|
}
|
|
public static function GetDictionary() : array
|
|
{
|
|
return Yaml::parseFile(__DIR__ . "/../Localisation/en-GB.yaml");
|
|
}
|
|
|
|
}
|
|
|