This commit is contained in:
taoser 2021-07-22 15:25:35 +08:00
parent 0a7983e698
commit d2d442dbcd
3 changed files with 6 additions and 7 deletions

1
.gitignore vendored
View File

@ -1,5 +1,4 @@
/.idea /.idea
/.vscode /.vscode
/data
*.log *.log
.env .env

View File

@ -29,10 +29,10 @@ use app\common\lib\SqlFile;
class Upgrade extends AdminController class Upgrade extends AdminController
{ {
public $root_dir = "../"; //站点代码的根目录 protected $root_dir = "../"; //站点代码的根目录
public $backup_dir = "../runtime/update/backup_dir/"; //备份目录 protected $backup_dir = "../runtime/update/backup_dir/"; //备份目录
public $upload_dir = "../runtime/update/upload_dir/"; //升级包目录 protected $upload_dir = "../runtime/update/upload_dir/"; //升级包目录
public $sys_version_num; //当前系统的版本 protected $sys_version_num; //当前系统的版本
public function __construct() public function __construct()
{ {
@ -142,6 +142,7 @@ class Upgrade extends AdminController
{ {
$versions = Api::urlPost($this->sys['upgrade_url'],['url'=>$this->sys['domain'],'key'=>$this->sys['key'],'pn'=>$this->pn,'ver'=>$this->sys_version]); $versions = Api::urlPost($this->sys['upgrade_url'],['url'=>$this->sys['domain'],'key'=>$this->sys['key'],'pn'=>$this->pn,'ver'=>$this->sys_version]);
Log::channel('update')->info('update:{type} {progress} {msg}',['type'=>'check','progress'=>'0%','msg'=>'===>升级检测开始===>']); Log::channel('update')->info('update:{type} {progress} {msg}',['type'=>'check','progress'=>'0%','msg'=>'===>升级检测开始===>']);
//判断服务器状态 //判断服务器状态
$version_code = $versions->code; $version_code = $versions->code;
if($version_code == -1){ if($version_code == -1){
@ -151,7 +152,7 @@ class Upgrade extends AdminController
$version_num = $versions->version; $version_num = $versions->version;
$file_url = $versions->src; $file_url = $versions->src;
//判断远程文件是否可用存在 //判断远程文件是否可用存在
$header = get_headers($file_url, true); $header = get_headers($file_url, true);
if(!isset($header[0]) && (strpos($header[0], '200') || strpos($header[0], '304'))){ if(!isset($header[0]) && (strpos($header[0], '200') || strpos($header[0], '304'))){

View File

@ -1 +0,0 @@
lock