diff --git a/src/Symfony/Component/Config/Resource/DirectoryResource.php b/src/Symfony/Component/Config/Resource/DirectoryResource.php index 120ab43d1937a..6ef58fc982e05 100644 --- a/src/Symfony/Component/Config/Resource/DirectoryResource.php +++ b/src/Symfony/Component/Config/Resource/DirectoryResource.php @@ -74,7 +74,9 @@ public function isFresh($timestamp) return false; } - $newestMTime = filemtime($this->resource); + if (filemtime($this->resource) < $timestamp) { + return true; + } foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->resource), \RecursiveIteratorIterator::SELF_FIRST) as $file) { // if regex filtering is enabled only check matching files if ($this->pattern && $file->isFile() && !preg_match($this->pattern, $file->getBasename())) { @@ -87,10 +89,12 @@ public function isFresh($timestamp) continue; } - $newestMTime = max($file->getMTime(), $newestMTime); + if ($file->getMTime() < $timestamp) { + return true + } } - return $newestMTime < $timestamp; + return false; } public function serialize()