mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 23:02:48 +08:00
改进
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
namespace think\console\command\optimize;
|
namespace think\console\command\optimize;
|
||||||
|
|
||||||
use think\Config;
|
use think\Config as ThinkConfig;
|
||||||
use think\console\command\Command;
|
use think\console\command\Command;
|
||||||
use think\console\Input;
|
use think\console\Input;
|
||||||
use think\console\input\Option;
|
use think\console\input\Option;
|
||||||
@@ -52,18 +52,18 @@ class Config extends Command
|
|||||||
$content = '';
|
$content = '';
|
||||||
$path = realpath(APP_PATH . $module) . DS;
|
$path = realpath(APP_PATH . $module) . DS;
|
||||||
// 加载模块配置
|
// 加载模块配置
|
||||||
$config = Config::load(CONF_PATH . $module . 'config' . CONF_EXT);
|
$config = ThinkConfig::load(CONF_PATH . $module . 'config' . CONF_EXT);
|
||||||
|
|
||||||
// 加载应用状态配置
|
// 加载应用状态配置
|
||||||
if ($config['app_status']) {
|
if ($config['app_status']) {
|
||||||
$config = Config::load(CONF_PATH . $module . $config['app_status'] . CONF_EXT);
|
$config = ThinkConfig::load(CONF_PATH . $module . $config['app_status'] . CONF_EXT);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 读取扩展配置文件
|
// 读取扩展配置文件
|
||||||
if ($config['extra_config_list']) {
|
if ($config['extra_config_list']) {
|
||||||
foreach ($config['extra_config_list'] as $name => $file) {
|
foreach ($config['extra_config_list'] as $name => $file) {
|
||||||
$filename = CONF_PATH . $module . $file . CONF_EXT;
|
$filename = CONF_PATH . $module . $file . CONF_EXT;
|
||||||
Config::load($filename, is_string($name) ? $name : pathinfo($filename, PATHINFO_FILENAME));
|
ThinkConfig::load($filename, is_string($name) ? $name : pathinfo($filename, PATHINFO_FILENAME));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,7 +82,7 @@ class Config extends Command
|
|||||||
$content .= substr(file_get_contents($path . 'common' . EXT), 5) . PHP_EOL;
|
$content .= substr(file_get_contents($path . 'common' . EXT), 5) . PHP_EOL;
|
||||||
}
|
}
|
||||||
|
|
||||||
$content .= '\think\Config::set(' . var_export(Config::get(), true) . ');';
|
$content .= '\think\Config::set(' . var_export(ThinkConfig::get(), true) . ');';
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user