1
0
Fork 0
oldhaven/php/core/classes/Config.class.php

21 lines
381 B
PHP
Raw Normal View History

2011-03-31 02:01:16 +00:00
<?php
class Config {
private static $_config = array();
public static function loadFile($config_name, $file_path) {
self::$_config[$config_name] = parse_ini_file($file_path, true);
}
public static function get($str) {
$path = explode(':', $str);
$res = self::$_config;
for ($i = 0; $i < count($path); $i++) {
$res = $res[$path[$i]];
}
return $res;
}
}
?>