File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
src/Symfony/Component/Config/Resource Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,10 @@ public function isFresh($timestamp)
6868 return false ;
6969 }
7070
71- $ newestMTime = filemtime ($ this ->resource );
71+ if ($ timestamp < $ newestMTime = filemtime ($ this ->resource )) {
72+ return false ;
73+ }
74+
7275 foreach (new \RecursiveIteratorIterator (new \RecursiveDirectoryIterator ($ this ->resource ), \RecursiveIteratorIterator::SELF_FIRST ) as $ file ) {
7376 // if regex filtering is enabled only check matching files
7477 if ($ this ->pattern && $ file ->isFile () && !preg_match ($ this ->pattern , $ file ->getBasename ())) {
@@ -81,7 +84,12 @@ public function isFresh($timestamp)
8184 continue ;
8285 }
8386
84- $ newestMTime = max ($ file ->getMTime (), $ newestMTime );
87+ // early return if a file's mtime is exceeds than passed timestamp
88+ if ($ timestamp < $ fileMTime = $ file ->getMTime ()) {
89+ return false ;
90+ }
91+
92+ $ newestMTime = max ($ fileMTime , $ newestMTime );
8593 }
8694
8795 return $ newestMTime < $ timestamp ;
You can’t perform that action at this time.
0 commit comments