mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-02 16:02:48 +08:00
发布新版本;增加自动替换脚本
This commit is contained in:
38
extend/base/admin/service/AdminUpdateCodeServiceBase.php
Normal file
38
extend/base/admin/service/AdminUpdateCodeServiceBase.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace base\admin\service;
|
||||
|
||||
use think\console\Input;
|
||||
use think\console\Output;
|
||||
use UpdateFunction;
|
||||
|
||||
class AdminUpdateCodeServiceBase
|
||||
{
|
||||
/**
|
||||
* @var Input
|
||||
*/
|
||||
public $input;
|
||||
|
||||
/**
|
||||
* @var Output
|
||||
*/
|
||||
public $output;
|
||||
|
||||
public function update($version)
|
||||
{
|
||||
$class_function_path = app_file_path('admin/service/adminUpdateCodeData/' . $version . '.php');
|
||||
|
||||
if (!file_exists($class_function_path)) {
|
||||
$this->output->error('指定版本无需特定更新');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
require_once $class_function_path;
|
||||
|
||||
$update_class = new UpdateFunction();
|
||||
$update_class->input = $this->input;
|
||||
$update_class->output = $this->output;
|
||||
$update_class->update();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user