* Refactor ajaxGetFixLogs.

This commit is contained in:
daitingting
2023-12-21 01:25:19 +00:00
parent 6b763efa36
commit 92caba58e4
+4 -4
View File
@@ -446,19 +446,19 @@ class upgrade extends control
}
/**
* 获取修复冲突的记录。
* Ajax get fix consistency logs.
*
* @param int $offset
* @access public
* @return void
*/
public function ajaxGetFixLogs($offset = 0)
public function ajaxGetFixLogs(int $offset = 0)
{
$logFile = $this->upgrade->getConsistencyLogFile();
$lines = !file_exists($logFile) ? array() : file($logFile);
$log = array_slice($lines, $offset);
$finished = ($log and end($log) == 'Finished') ? true : false;
$log = array_slice($lines, $offset);
$finished = ($log && end($log) == 'Finished') ? true : false;
return print(json_encode(array('log' => implode("<br />", $log) . "<br />", 'finished' => $finished, 'offset' => count($lines))));
}