/**
* 加载系统扩展配置
*/
public static function load()
{
$config = \think\Cache::get('db_config_cache_data');
if (!$config) {
// 在这里先判断一下数据库是否已经正确安装
$Db = \think\Loader::db();
$Query = $Db->query("SHOW TABLES LIKE '" . \think\Config::get('database.prefix') . "config'");
if (empty($Query)) {
self::install();
}
$data = \think\Db::name('Config')->where('status', 1)->field('type,name,value')->select();
$config = [];
if ($data && is_array($data)) {
foreach ($data as $value) {
$config[$value['name']] = self::parse($value['type'], $value['value']);
}
}
\think\Cache::set('db_config_cache_data', $config);
}
\think\Config::set($config);
}