Skip to content

Commit 6691915

Browse files
committed
LocalFilesystemAdapter. Call clearstatcache in several methods to avoid php's statcache.
Fixes #1826
1 parent e0e8d52 commit 6691915

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

LocalFilesystemAdapter.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,14 +337,14 @@ protected function ensureDirectoryExists(string $dirname, int $visibility): void
337337
public function fileExists(string $location): bool
338338
{
339339
$location = $this->prefixer->prefixPath($location);
340-
340+
clearstatcache();
341341
return is_file($location);
342342
}
343343

344344
public function directoryExists(string $location): bool
345345
{
346346
$location = $this->prefixer->prefixPath($location);
347-
347+
clearstatcache();
348348
return is_dir($location);
349349
}
350350

@@ -423,6 +423,7 @@ public function mimeType(string $path): FileAttributes
423423
public function lastModified(string $path): FileAttributes
424424
{
425425
$location = $this->prefixer->prefixPath($path);
426+
clearstatcache();
426427
error_clear_last();
427428
$lastModified = @filemtime($location);
428429

@@ -436,6 +437,7 @@ public function lastModified(string $path): FileAttributes
436437
public function fileSize(string $path): FileAttributes
437438
{
438439
$location = $this->prefixer->prefixPath($path);
440+
clearstatcache();
439441
error_clear_last();
440442

441443
if (is_file($location) && ($fileSize = @filesize($location)) !== false) {

0 commit comments

Comments
 (0)