示例#1
0
 /**
  * _load
  * 载入配置
  *
  * @param  string $rootkey 根key
  * @param  mixed $conf 配置
  * @param  string $file 定义配置文件
  * throw new FConfig_Exception
  *
  * @return void
  */
 protected function _load($rootkey, $conf = false, $file = null)
 {
     if ($conf === false) {
         if (in_array($file, self::$_loaded)) {
             return;
         } else {
             array_push(self::$_loaded, $file);
         }
         if (!is_file($file)) {
             $file = FLIB_ROOT . '/config/global.php';
         }
         require_once $file;
     }
     if (is_array($conf)) {
         foreach ($conf as $key => $value) {
             FConfig::set($rootkey . '.' . $key, $value);
         }
     }
 }