File tree 1 file changed +10
-2
lines changed
src/Symfony/Component/Config/Resource
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)
68
68
return false ;
69
69
}
70
70
71
- $ newestMTime = filemtime ($ this ->resource );
71
+ if (($ newestMTime = filemtime ($ this ->resource )) > $ timestamp ) {
72
+ return false ;
73
+ }
74
+
72
75
foreach (new \RecursiveIteratorIterator (new \RecursiveDirectoryIterator ($ this ->resource ), \RecursiveIteratorIterator::SELF_FIRST ) as $ file ) {
73
76
// if regex filtering is enabled only check matching files
74
77
if ($ this ->pattern && $ file ->isFile () && !preg_match ($ this ->pattern , $ file ->getBasename ())) {
@@ -81,7 +84,12 @@ public function isFresh($timestamp)
81
84
continue ;
82
85
}
83
86
84
- $ newestMTime = max ($ file ->getMTime (), $ newestMTime );
87
+ // early return if a file's mtime is exceeds than passed timestamp
88
+ if (($ fileMTime = $ file ->getMTime ()) > $ timestamp ) {
89
+ return false ;
90
+ }
91
+
92
+ $ newestMTime = max ($ fileMTime , $ newestMTime );
85
93
}
86
94
87
95
return $ newestMTime < $ timestamp ;
You can’t perform that action at this time.
0 commit comments