为基于框架的产品预留更新机制;

This commit is contained in:
augushong
2024-10-14 18:01:10 +08:00
parent 090ab096c0
commit 40a00be9d6
4 changed files with 48 additions and 19 deletions

View File

@@ -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();

View File

@@ -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);