Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix log iterator rewind not resetting state
Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 authored and backportbot[bot] committed Apr 30, 2024
commit b32d677c40d80876d949a1a81d3d8b17abf7b556
6 changes: 5 additions & 1 deletion lib/Log/LogIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,16 @@ public function __construct($handle, string $dateFormat, string $timezone) {
$this->handle = $handle;
$this->dateFormat = $dateFormat;
$this->timezone = new \DateTimeZone($timezone);
$this->rewind();
}

public function rewind(): void {
fseek($this->handle, 0, SEEK_END);
$this->position = ftell($this->handle);
$this->currentKey = 0;
$this->lastLine = '';
$this->buffer = '';
$this->currentKey = -1;
$this->next();
}

/**
Expand Down