示例#1
0
文件: config.php 项目: hitzheng/ares
 /**
  * 获取配置文件中的配置
  * @param  [type] $key     按.分隔,第一部分是配置文件名
  * @param  [type] $default [description]
  * @return [type]          [description]
  */
 public static function get($key, $default = null)
 {
     $tmp = explode('.', $key, 2);
     $file = $tmp[0];
     $path = empty($tmp[1]) ? null : $tmp[1];
     if (!isset(self::$_config[$file])) {
         self::_load($file);
     }
     if (null === $path) {
         return self::$_config[$file];
     } else {
         $value = Tool_Array::get(self::$_config[$file], $path);
         return null === $value ? $default : $value;
     }
 }