Skip to content
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

fixing php 32 bit (arm) filemtime on large file issue (#18971) #25428

Merged
merged 2 commits into from
Sep 29, 2016
Merged
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
11 changes: 9 additions & 2 deletions lib/private/Files/Storage/Local.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,15 @@ public function file_exists($path) {
}

public function filemtime($path) {
clearstatcache($this->getSourcePath($path));
return $this->file_exists($path) ? filemtime($this->getSourcePath($path)) : false;
$fullPath = $this->getSourcePath($path);
clearstatcache($fullPath);
if (!$this->file_exists($path)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could probably be inside the 32bit block to save a bit of time

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry not sure I get that, are you talking about moving file existence check inside 32bjt block?
I thought this is platform independent check which prevents us from doing any modify time work if file does not exist.

return false;
}
if (PHP_INT_SIZE === 4) {
return (int) exec ('stat -c %Y '. escapeshellarg ($fullPath));
}
return filemtime($fullPath);
}

public function touch($path, $mtime = null) {
Expand Down