minor #26031 [Config] Only using filemtime to check file freshness (dmifedorenko)
This PR was merged into the 3.4 branch.
Discussion
----------
[Config] Only using filemtime to check file freshness
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #25999
| License | MIT
Commits
-------
52c9cb4
[Config] Only using filemtime to check file freshness
This commit is contained in:
commit
cb6c48cc36
@ -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()
|
||||
|
@ -40,11 +40,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();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user