Update common.php

pull/73/head
qkqpttgf 2020-06-03 18:30:11 +08:00 committed by GitHub
parent fdd4d16041
commit 80b1e9e808
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 3 deletions

View File

@ -1654,7 +1654,22 @@ function EnvOpt($needUpdate = 0)
} }
$html .= ' $html .= '
<a href="?AddDisk">'.getconstStr('AddDisk').'</a><br><br>'; <a href="?AddDisk">'.getconstStr('AddDisk').'</a><br><br>';
if (!( (isset($_SERVER['USER'])&&$_SERVER['USER']==='qcloud') || (isset($_SERVER['HEROKU_APP_DIR'])&&$_SERVER['HEROKU_APP_DIR']==='/app') || (isset($_SERVER['FC_SERVER_PATH'])&&$_SERVER['FC_SERVER_PATH']==='/var/fc/runtime/php7.2') )) {
$canOneKeyUpate = 0;
if (isset($_SERVER['USER'])&&$_SERVER['USER']==='qcloud') {
$canOneKeyUpate = 1;
} elseif (isset($_SERVER['HEROKU_APP_DIR'])&&$_SERVER['HEROKU_APP_DIR']==='/app') {
$canOneKeyUpate = 1;
} elseif (isset($_SERVER['FC_SERVER_PATH'])&&$_SERVER['FC_SERVER_PATH']==='/var/fc/runtime/php7.2') {
$canOneKeyUpate = 1;
} else {
$tmp = time();
if ( mkdir(''.$tmp, 0777) ) {
rmdir(''.$tmp);
$canOneKeyUpate = 1;
}
}
if (!$canOneKeyUpate) {
$html .= ' $html .= '
'.getconstStr('VPSnotupdate').'<br>'; '.getconstStr('VPSnotupdate').'<br>';
} else { } else {
@ -1701,9 +1716,9 @@ function EnvOpt($needUpdate = 0)
$html .= '<div style="position:relative;word-wrap: break-word;"> $html .= '<div style="position:relative;word-wrap: break-word;">
' . str_replace("\r", '<br>',$_SERVER['github_version']) . ' ' . str_replace("\r", '<br>',$_SERVER['github_version']) . '
</div>'; </div>';
} else { }/* else {
$html .= getconstStr('NotNeedUpdate'); $html .= getconstStr('NotNeedUpdate');
} }*/
return message($html, getconstStr('Setup')); return message($html, getconstStr('Setup'));
} }