* finish task #7795.

This commit is contained in:
z
2020-09-03 16:32:39 +08:00
parent 40dbb5b53a
commit 8e2f4654c4
3 changed files with 18 additions and 6 deletions
+15 -1
View File
@@ -1405,6 +1405,20 @@ EOD;
return $hasField;
}
/**
* Check safe file.
*
* @access public
* @return string|false
*/
public function checkSafeFile()
{
if($this->app->getModuleName() == 'upgrade' and $this->session->upgrading) return false;
$statusFile = $this->app->getAppRoot() . 'www' . DIRECTORY_SEPARATOR . 'ok.txt';
return (!is_file($statusFile) or (time() - filemtime($statusFile)) > 3600) ? $statusFile : false;
}
/**
* Check upgrade's status file is ok or not.
*
@@ -1413,7 +1427,7 @@ EOD;
*/
public function checkUpgradeStatus()
{
$statusFile = $this->loadModel('upgrade')->checkSafeFile();
$statusFile = $this->checkSafeFile();
if($statusFile)
{
$cmd = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' ? $this->lang->upgrade->createFileWinCMD : $this->lang->upgrade->createFileLinuxCMD;