src/Core/Delegate.php
private static function initConfig($app_name, array $runtime_config)
    {
        $request = Request::getInstance();
        $host = $request->getHostInfo();
        $index_name = $request->getIndexName();

        $request_url = $request->getBaseUrl();
        $script_path = $request->getScriptFilePath();

        //app名称和路径
        $runtime_config['app'] = array(
            'name' => $app_name,
            'path' => APP_PATH_DIR . $app_name . DIRECTORY_SEPARATOR
        );

        $env_config = array(
            //url相关设置
            'url' => array(
                'host' => $host,
                'index' => $index_name,
                'request' => $request_url,
                'full_request' => $host . $request_url
            ),

            //配置和缓存的绝对路径
            'path' => array(
                'cache' => PROJECT_REAL_PATH . 'cache' . DIRECTORY_SEPARATOR,
                'config' => PROJECT_REAL_PATH . 'config' . DIRECTORY_SEPARATOR,
                'script' => $script_path . DIRECTORY_SEPARATOR,
            ),

            //静态文件url和绝对路径
            'static' => array(
                'url' => $host . $request_url . '/static/',
                'path' => $script_path . DIRECTORY_SEPARATOR . 'static' . DIRECTORY_SEPARATOR
            )
        );

        foreach ($env_config as $key => $value) {
            if (isset($runtime_config[$key]) && is_array($runtime_config[$key])) {
                $runtime_config[$key] = array_merge($value, $runtime_config[$key]);
            } elseif (!isset($runtime_config[$key])) {
                $runtime_config[$key] = $value;
            }
        }

        return Config::load(APP_PATH_DIR . $app_name . DIRECTORY_SEPARATOR . 'init.php')->combine($runtime_config);
    }
private static function initConfig($app_name, array $runtime_config)
    {
        $request = Request::getInstance();
        $host = $request->getHostInfo();
        $index_name = $request->getIndexName();

        $request_url = $request->getBaseUrl();
        $script_path = $request->getScriptFilePath();

        //app名称和路径
        $runtime_config['app'] = array(
            'name' => $app_name,
            'path' => APP_PATH_DIR . $app_name . DIRECTORY_SEPARATOR
        );

        $env_config = array(
            //url相关设置
            'url' => array(
                'host' => $host,
                'index' => $index_name,
                'request' => $request_url,
                'full_request' => $host . $request_url
            ),

            //配置和缓存的绝对路径
            'path' => array(
                'cache' => PROJECT_REAL_PATH . 'cache' . DIRECTORY_SEPARATOR,
                'config' => PROJECT_REAL_PATH . 'config' . DIRECTORY_SEPARATOR,
                'script' => $script_path . DIRECTORY_SEPARATOR,
            ),

            //静态文件url和绝对路径
            'static' => array(
                'url' => $host . $request_url . '/static/',
                'path' => $script_path . DIRECTORY_SEPARATOR . 'static' . DIRECTORY_SEPARATOR
            )
        );

        foreach ($env_config as $key => $value) {
            if (isset($runtime_config[$key]) && is_array($runtime_config[$key])) {
                $runtime_config[$key] = array_merge($value, $runtime_config[$key]);
            } elseif (!isset($runtime_config[$key])) {
                $runtime_config[$key] = $value;
            }
        }

        return Config::load(APP_PATH_DIR . $app_name . DIRECTORY_SEPARATOR . 'init.php')->combine($runtime_config);
    }
初始化App配置

@param string $app_name
@param array $runtime_config
@return Config
@throws FrontException
@throws CoreException