mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-05 17:42:49 +08:00
为基于框架的产品预留更新机制;
This commit is contained in:
@@ -12,11 +12,15 @@ use think\console\Output;
|
||||
|
||||
class UpdateBase extends Command
|
||||
{
|
||||
|
||||
public const REPO = null;
|
||||
|
||||
protected function configure()
|
||||
{
|
||||
// 指令配置
|
||||
$this->setName('admin:update')
|
||||
->addOption('reinstall', null, Option::VALUE_NONE, '重装版本')
|
||||
->addOption('update-ulthon', null, Option::VALUE_NONE, '重装版本')
|
||||
->setDescription('the admin:update command');
|
||||
}
|
||||
|
||||
@@ -25,7 +29,13 @@ class UpdateBase extends Command
|
||||
// 指令输出
|
||||
$output->writeln('admin:update');
|
||||
|
||||
$update_service = new AdminUpdateService();
|
||||
$repo = static::REPO;
|
||||
|
||||
if($input->hasOption('update-ulthon')){
|
||||
$repo = null;
|
||||
}
|
||||
|
||||
$update_service = new AdminUpdateService($repo);
|
||||
$update_service->input = $input;
|
||||
$update_service->output = $output;
|
||||
$update_service->update();
|
||||
|
||||
@@ -14,6 +14,8 @@ class VersionBase extends Command
|
||||
{
|
||||
public const VERSION = 'v2.0.103';
|
||||
|
||||
public const PRODUCT_VERSION = '';
|
||||
|
||||
public const LAYUI_VERSION = '2.8.17';
|
||||
|
||||
public const COMMENT = [
|
||||
@@ -32,7 +34,10 @@ class VersionBase extends Command
|
||||
protected function execute(Input $input, Output $output)
|
||||
{
|
||||
// 指令输出
|
||||
$output->info('当前版本号为:' . $this::VERSION);
|
||||
if (!empty(static::PRODUCT_VERSION)) {
|
||||
$output->info('当前版本号为:' . $this::PRODUCT_VERSION);
|
||||
}
|
||||
$output->info('当前ulthon_admin版本号为:' . $this::VERSION);
|
||||
$output->info('当前Layui版本号为:' . $this::LAYUI_VERSION);
|
||||
$output->info('当前ThinkPHP版本号为:' . ThinkApp::VERSION);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user