/** * @return Config */ public static function getInstance() { if (self::$instance == null) { self::$instance = new self(); } return self::$instance; }
/** * load configuration * * @param string|bool $path */ public static function Load($path = false) { $configPath = '../etc/config.json'; if ($path) { $configPath = $path; } $config = file_get_contents($configPath); self::$_loadedConfig = json_decode($config, true); }
public static function get($param, $default = null) { if (empty(self::$config)) { self::$config = Yaml::parse(file_get_contents(__DIR__ . '/' . self::CONFIG_FILE)); } if (isset(self::$config[$param])) { return self::$config[$param]; } elseif (null !== $default) { return $default; } return null; }