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 @@ -74,7 +74,10 @@ public function isFresh($timestamp)
74
74
return false ;
75
75
}
76
76
77
- $ newestMTime = filemtime ($ this ->resource );
77
+ if (($ newestMTime = filemtime ($ this ->resource )) > $ timestamp ) {
78
+ return false ;
79
+ }
80
+
78
81
foreach (new \RecursiveIteratorIterator (new \RecursiveDirectoryIterator ($ this ->resource ), \RecursiveIteratorIterator::SELF_FIRST ) as $ file ) {
79
82
// if regex filtering is enabled only check matching files
80
83
if ($ this ->pattern && $ file ->isFile () && !preg_match ($ this ->pattern , $ file ->getBasename ())) {
@@ -87,7 +90,12 @@ public function isFresh($timestamp)
87
90
continue ;
88
91
}
89
92
90
- $ newestMTime = max ($ file ->getMTime (), $ newestMTime );
93
+ // early return if any file mtime is greater than passed timestamp
94
+ if (($ fileMTime = $ file ->getMTime ()) > $ timestamp ) {
95
+ return false ;
96
+ }
97
+
98
+ $ newestMTime = max ($ fileMTime , $ newestMTime );
91
99
}
92
100
93
101
return $ newestMTime < $ timestamp ;
You can’t perform that action at this time.
0 commit comments