[Config] Only using filemtime to check file freshness

This commit is contained in:
Dmitriy Fedorenko 2018-02-03 17:33:10 +10:00 committed by Nicolas Grekas
parent 9f64a0fbd9
commit 52c9cb4025
2 changed files with 3 additions and 3 deletions

View File

@ -60,7 +60,7 @@ class FileResource implements SelfCheckingResourceInterface, \Serializable
*/
public function isFresh($timestamp)
{
return file_exists($this->resource) && @filemtime($this->resource) <= $timestamp;
return false !== ($filemtime = @filemtime($this->resource)) && $filemtime <= $timestamp;
}
public function serialize()

View File

@ -37,11 +37,11 @@ class ReflectionClassResource implements SelfCheckingResourceInterface, \Seriali
}
foreach ($this->files as $file => $v) {
if (!file_exists($file)) {
if (false === $filemtime = @filemtime($file)) {
return false;
}
if (@filemtime($file) > $timestamp) {
if ($filemtime > $timestamp) {
return $this->hash === $this->computeHash();
}
}