1 Star 0 Fork 88

jiangjiawei / YoungxjTools

forked from Young小杰 / YoungxjTools 
Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
UpdateAction.php 1.29 KB
Copy Edit Raw Blame History
Young小杰 authored 2018-07-12 22:05 . 1.3发布
<?php
include 'function.base.php';
$CONF = require('function.config.php');
define('VERSION', $CONF['config']['VERSION']);
// 应用目录为当前目录
define('APP_PATH', __DIR__ . '/');
function UpdateAction(){
include 'Autoupdate.class.php';
$update = new Autoupdate(APP_PATH,false);
$update->currentVersion = VERSION;
$update->updateUrl = 'https://api.yum6.cn/service/';
$latest = $update->checkUpdate();
if ($latest !== false) {
if ($latest > $update->currentVersion) {
if ($update->update()) {
if($update->replaceupdate()){
$res=['code'=>'0000','msg'=>'更新成功,欢迎体验最新的YoungxjTools系统^_^'];
}else{
$res=['code'=>'0004','msg'=>'更新文件效验失败!'];
}
}else {
$res=['code'=>'0002','msg'=>'在线更新失败,请尝试手动更新!信息:'.$update->getLastError()];
}
}else {
$res=['code'=>'0001','msg'=>'没有发现可用的新版本!'];
}
} else {
$res=['code'=>'0003','msg'=>$update->getLastError()];
}
echo json_encode($res);
}
if($_POST['token']==md5(md5((int)(time()/1200)).'YoungxjTools')){
UpdateAction();
}else{
exit('非法请求');
}
PHP
1
https://gitee.com/jiangjiawei520172/YoungxjTools.git
git@gitee.com:jiangjiawei520172/YoungxjTools.git
jiangjiawei520172
YoungxjTools
YoungxjTools
master

Search