src/wula/cms/CmfConfigurationLoader.php
public function loadConfig($name = 'default') {
        //优先从文件加载
        $config = parent::loadConfig($name);
        if (WULACMF_INSTALLED) {
            if ($name == 'default' && !defined('DEBUG')) {
                $debug = $config->get('debug', DEBUG_ERROR);
                if ($debug > 1000 || $debug < 0) {
                    $debug = DEBUG_OFF;
                }
                define('DEBUG', $debug);
            }
            //从缓存加载
            $setting = RtCache::get('cfg.' . $name);
            if (!is_array($setting)) {
                //从数据库加载
                try {
                    $setting = App::table('settings')->findAll(['group' => $name], 'name,value')->toArray('value', 'name');
                    RtCache::add('cfg.' . $name, $setting);
                } catch (\Exception $e) {
                    log_warn($e->getMessage());//无法连接数据库
                }
            }
            if ($setting) {
                $config->setConfigs($setting);
            }
        }

        return $config;
    }
public function loadConfig($name = 'default') {
        //优先从文件加载
        $config = parent::loadConfig($name);
        if (WULACMF_INSTALLED) {
            if ($name == 'default' && !defined('DEBUG')) {
                $debug = $config->get('debug', DEBUG_ERROR);
                if ($debug > 1000 || $debug < 0) {
                    $debug = DEBUG_OFF;
                }
                define('DEBUG', $debug);
            }
            //从缓存加载
            $setting = RtCache::get('cfg.' . $name);
            if (!is_array($setting)) {
                //从数据库加载
                try {
                    $setting = App::table('settings')->findAll(['group' => $name], 'name,value')->toArray('value', 'name');
                    RtCache::add('cfg.' . $name, $setting);
                } catch (\Exception $e) {
                    log_warn($e->getMessage());//无法连接数据库
                }
            }
            if ($setting) {
                $config->setConfigs($setting);
            }
        }

        return $config;
    }
@param string $name

@return mixed|\wulaphp\conf\Configuration