Skip to content

LocalFilesystemAdapter. Call clearstatcache in several methods #1873

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 3.x
Choose a base branch
from
Open
Changes from all commits
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
6 changes: 4 additions & 2 deletions src/Local/LocalFilesystemAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -337,14 +337,14 @@ protected function ensureDirectoryExists(string $dirname, int $visibility): void
public function fileExists(string $location): bool
{
$location = $this->prefixer->prefixPath($location);

clearstatcache();
return is_file($location);
}

public function directoryExists(string $location): bool
{
$location = $this->prefixer->prefixPath($location);

clearstatcache();
return is_dir($location);
}

Expand Down Expand Up @@ -423,6 +423,7 @@ public function mimeType(string $path): FileAttributes
public function lastModified(string $path): FileAttributes
{
$location = $this->prefixer->prefixPath($path);
clearstatcache();
error_clear_last();
$lastModified = @filemtime($location);

Expand All @@ -436,6 +437,7 @@ public function lastModified(string $path): FileAttributes
public function fileSize(string $path): FileAttributes
{
$location = $this->prefixer->prefixPath($path);
clearstatcache();
error_clear_last();

if (is_file($location) && ($fileSize = @filesize($location)) !== false) {
Expand Down
Loading