Skip to content

Commit

Permalink
Fix type error (again)
Browse files Browse the repository at this point in the history
  • Loading branch information
austinwbest committed Nov 10, 2024
1 parent 7deefd6 commit 975c591
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion root/app/www/public/functions/logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,13 @@ function getLog($logfile, $page = 1, $app = false)

$starr = $starr ?:new Starr();
list($logLines, $file) = explode(' ', $shell->exec('wc -l ' . $logfile));
$logLines = intval(trim($logLines));
$cmd = $app ? 'tail -' . LOG_LINES_PER_PAGE . ' ' . $logfile : 'awk -vs="' . $start . '" -ve="' . $end . '" \'NR>=s&&NR<=e\' "' . $logfile . '"';
$file = $shell->exec($cmd);
$lines = explode("\n", $file);
rsort($lines);

$pages = ceil(intval(trim($logLines)) / LOG_LINES_PER_PAGE);
$pages = ceil($logLines / LOG_LINES_PER_PAGE);
$pages = $pages > 1 ? $pages : 1;

?>
Expand Down

0 comments on commit 975c591

Please sign in to comment.