21 lines
381 B
PHP
21 lines
381 B
PHP
<?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;
|
|
}
|
|
}
|
|
|
|
?>
|