该系统为使用PHP开发的基于web的Subversion(SVN)服务器端管理工具。支持功能:SVN仓库管理、SVN用户管理、SVN分组管理、目录授权、目录浏览、Hooks管理、在线dump备份、在线备份恢复、SVN用户禁用、服务器状态管理、日志管理、消息通知、更新检测...
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

66 lines
2.2 KiB

<?php
/*
* @Author: witersen
* @Date: 2022-04-24 23:37:05
* @LastEditors: witersen
* @LastEditTime: 2022-05-07 14:25:15
* @Description: QQ:1801168257
*/
namespace app\service;
class Update extends Base
{
function __construct()
{
parent::__construct();
}
/**
* 获取当前版本信息
*/
public function GetVersion()
{
return message(200, 1, '成功', [
'current_verson' => $this->config_version['version'],
'github' => 'https://github.com/witersen/svnAdminV2.0',
'gitee' => 'https://gitee.com/witersen/SvnAdminV2.0',
'author' => 'https://www.witersen.com'
]);
}
/**
* 检测新版本
*/
public function CheckUpdate($payload)
{
foreach ($this->config_update['update_server'] as $key => $value) {
$versionInfo = FunCurlRequest($value);
if ($versionInfo != null) {
$versionInfo = json_decode($versionInfo, true);
$latestVersion = $versionInfo['latestVersion'];
if ($latestVersion == $this->config_version['version']) {
return message(200, 1, '当前版本为最新版');
} else if ($latestVersion > $this->config_version['version']) {
return message(200, 1, '有更新', [
'latestVersion' => $versionInfo['latestVersion'],
'fixedContent' => implode('<br>', $versionInfo['fixedContent']) == '' ? '暂无内容' : implode('<br>', $versionInfo['fixedContent']),
'newContent' => implode('<br>', $versionInfo['newContent']) == '' ? '暂无内容' : implode('<br>', $versionInfo['newContent']),
'updateType' => $versionInfo['updateType'],
'updateStep' => $versionInfo['updateStep']
]);
} else if ($latestVersion < $this->config_version['version']) {
return message(200, 0, '系统版本错误');
}
}
}
return message(200, 0, '检测更新超时');
}
/**
* 确认更新
*/
public function StartUpdate($payload)
{
}
}