try fix: can not update in php8

pull/276/head
qkqpttgf 2021-03-14 16:42:31 +08:00 committed by GitHub
parent 273f41d90b
commit 2850db0699
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -317,8 +317,8 @@ function OnekeyUpate($auth = 'qkqpttgf', $project = 'OneManager-php', $branch =
$githubfile = file_get_contents($url);
if (!$githubfile) return 0;
file_put_contents($tarfile, $githubfile);
if (splitfirst(PHP_VERSION, '.')[0] == '7') {
$phar = new PharData($tarfile); // need php7
if (splitfirst(PHP_VERSION, '.')[0] > '5') {
$phar = new PharData($tarfile); // need php5.3, 7, 8
$phar->extractTo($projectPath, null, true);//路径 要解压的文件 是否覆盖
} else {
ob_start();