Skip to content

Commit ec7f539

Browse files
committed
add abolute path to size call
1 parent 65be109 commit ec7f539

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/LogFile.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ public function __construct(string $path)
3838
$this->subFolder = str_replace($this->name, '', $path);
3939
$this->subFolder = rtrim($this->subFolder, DIRECTORY_SEPARATOR);
4040

41-
// if (str_starts_with($path, DIRECTORY_SEPARATOR)) {
42-
// $this->absolutePath = pathinfo($path)['dirname'];
43-
// $this->path = pathinfo($path)['basename'];
44-
// }
41+
if (str_starts_with($path, DIRECTORY_SEPARATOR)) {
42+
$this->absolutePath = pathinfo($path)['dirname'];
43+
$this->path = pathinfo($path)['basename'];
44+
}
4545

4646
$this->loadMetadata();
4747
}
@@ -62,8 +62,8 @@ public function logs(): LogReader
6262

6363
public function size(): int
6464
{
65-
return LogViewer::getFilesystem()->exists($this->path)
66-
? LogViewer::getFilesystem()->size($this->path)
65+
return LogViewer::getFilesystem($this->absolutePath)->exists($this->path)
66+
? LogViewer::getFilesystem($this->absolutePath)->size($this->path)
6767
: 0;
6868
}
6969

0 commit comments

Comments
 (0)