mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
增加模块版本号
This commit is contained in:
parent
a57c3a9373
commit
52f6627cb8
@ -37,6 +37,24 @@ class Update extends Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取模块版本
|
||||||
|
*/
|
||||||
|
public function version()
|
||||||
|
{
|
||||||
|
$input = $this->_vali(['module.require' => '模块名称不能为空!']);
|
||||||
|
$filename = $this->app->getRootPath() . 'app' . DIRECTORY_SEPARATOR . $input['module'] . DIRECTORY_SEPARATOR . 'ver.php';
|
||||||
|
if (file_exists($filename) && is_file($filename) && is_array($vars = include $filename)) {
|
||||||
|
if (isset($vars['name']) && isset($vars['version']) && isset($vars['content']) && isset($vars['changes'])) {
|
||||||
|
$this->success('获取模块版本成功!', $vars);
|
||||||
|
} else {
|
||||||
|
$this->error('获取模块版本失败!');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$this->error('获取的模块无效!');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 读取文件列表
|
* 读取文件列表
|
||||||
*/
|
*/
|
||||||
|
29
app/admin/ver.php
Normal file
29
app/admin/ver.php
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | ThinkAdmin
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | 版权所有 2014~2020 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | 官方网站: https://thinkadmin.top
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | 开源协议 ( https://mit-license.org )
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
|
||||||
|
// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
|
||||||
|
// 模块配置文件
|
||||||
|
return [
|
||||||
|
'name' => 'admin',
|
||||||
|
'author' => 'Anyon',
|
||||||
|
'version' => '2020.08.03.01',
|
||||||
|
'content' => 'ThinkAdmin 系统基础模块',
|
||||||
|
'changes' => [
|
||||||
|
'2020.08.03.00' => [
|
||||||
|
'database' => [
|
||||||
|
'select version()',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
];
|
29
app/wechat/ver.php
Normal file
29
app/wechat/ver.php
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | ThinkAdmin
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | 版权所有 2014~2020 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | 官方网站: https://thinkadmin.top
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | 开源协议 ( https://mit-license.org )
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
|
||||||
|
// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
|
||||||
|
// 模块配置文件
|
||||||
|
return [
|
||||||
|
'name' => 'wechat',
|
||||||
|
'author' => 'Anyon',
|
||||||
|
'version' => '2020.08.03.01',
|
||||||
|
'content' => 'ThinkAdmin 微信基础模块',
|
||||||
|
'changes' => [
|
||||||
|
'2020.08.03.00' => [
|
||||||
|
'database' => [
|
||||||
|
'select version()',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
];
|
Loading…
x
Reference in New Issue
Block a user