Exemple #1
0
/**
 * 自动加载指定路径的下的配置文件
 * @param type $configPath 路径或路径的集合
 * @return boolean 单个路径时,TRUE表示加载成功了该路径。
 */
function DILoadConfig($configPath)
{
    if (is_array($configPath)) {
        foreach ($configPath as $path) {
            DILoadConfig($path);
        }
    } else {
        if (file_exists($configPath)) {
            C(load_config($configPath));
            return TRUE;
        } else {
            return FALSE;
        }
    }
}
Exemple #2
0
 /**
  * 重新加载WorkerConfig
  */
 private function ReloadWorkerConfig()
 {
     $configPath = AllFile(DI_APP_SERVER_WORKER_CONFIG_PATH, true, 'Config.php');
     DILoadConfig($configPath);
 }
Exemple #3
0
 /**
  * 初始化应用配置(当前Server独占)
  */
 protected function LoadServerConfig()
 {
     //加载Server目录下所有的配置文件(以Config.php结尾)
     $configsPath = AllFile(DI_APP_SERVER_CONF_PATH, true, 'Config.php');
     DILoadConfig($configsPath);
 }