File: /www/exchange0old/exchange/Bin/Config.php
<?php
class Bin_Config {
private static $config = null;
public static function get($path, $default = null) {
if (self::$config === null) {
self::load();
}
// * For debug only
if ($path === null) {
return self::$config;
}
return Bin_Array::path(self::$config, $path, $default);
}
protected static function load() {
// * Try to load config
$configFile = ROOT_FOLDER.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'default.php';
if (!file_exists($configFile)) {
throw new Exception('Unable load default configuration from default.php');
}
self::$config = (array) require_once($configFile);
}
public static function requireAdminModel($model) {
$models = func_get_args();
foreach ($models as $currentModel) {
$currentModel = str_replace('_',DIRECTORY_SEPARATOR, $currentModel);
require_once(ROOT_FOLDER.'/admin/classes/Model/'.$currentModel.'.php');
}
}
}