2024-05-10 16:01:21 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App;
|
|
|
|
|
|
|
|
class PhyreConfig
|
|
|
|
{
|
|
|
|
public static function get($key, $default = null)
|
|
|
|
{
|
|
|
|
// Parse without sections
|
2024-05-10 16:12:23 +00:00
|
|
|
$configIni = base_path() . "/phyre-config.ini";
|
|
|
|
if (file_exists($configIni)) {
|
|
|
|
$iniArray = parse_ini_file($configIni);
|
|
|
|
if (isset($iniArray[$key])) {
|
|
|
|
return $iniArray[$key];
|
|
|
|
}
|
2024-05-10 16:01:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return $default;
|
|
|
|
}
|
|
|
|
|
2024-05-11 09:43:00 +00:00
|
|
|
public static function getAll()
|
|
|
|
{
|
|
|
|
// Parse without sections
|
|
|
|
$configIni = base_path() . "/phyre-config.ini";
|
|
|
|
if (file_exists($configIni)) {
|
|
|
|
$iniArray = parse_ini_file($configIni);
|
|
|
|
return $iniArray;
|
|
|
|
}
|
|
|
|
|
|
|
|
return [];
|
|
|
|
}
|
2024-05-10 16:01:21 +00:00
|
|
|
}
|