Skip to content

Commit

Permalink
Clear stat cache before lookup
Browse files Browse the repository at this point in the history
Fixes #7.
  • Loading branch information
kelunik committed Sep 28, 2018
1 parent 0a8a066 commit 6b6654c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/DocumentRoot.php
Expand Up @@ -229,6 +229,7 @@ private function lookup(string $path): \Generator
$fileInfo->exists = false;
$fileInfo->path = $path;

File\StatCache::clear($path);
if (!$stat = yield $this->filesystem->stat($path)) {
return $fileInfo;
}
Expand All @@ -250,6 +251,7 @@ private function lookup(string $path): \Generator

if ($this->shouldBufferContent($fileInfo)) {
$fileInfo->buffer = yield $this->filesystem->get($fileInfo->path);
$fileInfo->size = \strlen($fileInfo->buffer); // there's a slight chance for the size to change, be safe
$this->bufferedFileCount++;
}

Expand Down

0 comments on commit 6b6654c

Please sign in to comment.