diff --git a/CHANGELOG-3.4.md b/CHANGELOG-3.4.md index 39bdf7acc9a6f..033dc4d684c6a 100644 --- a/CHANGELOG-3.4.md +++ b/CHANGELOG-3.4.md @@ -7,6 +7,10 @@ in 3.4 minor versions. To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v3.4.0...v3.4.1 +* 3.4.x (2018-xx-xx) + + * bug #25999 [DependencyInjection] Huge performance degradation of ReflectionClassResource and FileResource on big projects inside Docker For Mac + * 3.4.4 (2018-01-29) * bug #25932 Don't stop PSR-4 service discovery if a parent class is missing (derrabus) diff --git a/src/Symfony/Component/Config/Resource/FileResource.php b/src/Symfony/Component/Config/Resource/FileResource.php index 5d71d87918c8f..cb6ad2e072694 100644 --- a/src/Symfony/Component/Config/Resource/FileResource.php +++ b/src/Symfony/Component/Config/Resource/FileResource.php @@ -60,7 +60,9 @@ public function getResource() */ public function isFresh($timestamp) { - return file_exists($this->resource) && @filemtime($this->resource) <= $timestamp; + $filemtime = @filemtime($this->resource); + + return $filemtime && $filemtime <= $timestamp; } public function serialize() diff --git a/src/Symfony/Component/Config/Resource/ReflectionClassResource.php b/src/Symfony/Component/Config/Resource/ReflectionClassResource.php index a8e1f9611b99a..1371d7d6fe322 100644 --- a/src/Symfony/Component/Config/Resource/ReflectionClassResource.php +++ b/src/Symfony/Component/Config/Resource/ReflectionClassResource.php @@ -37,11 +37,12 @@ public function isFresh($timestamp) } foreach ($this->files as $file => $v) { - if (!file_exists($file)) { + $filemtime = @filemtime($file); + if (!$filemtime) { return false; } - if (@filemtime($file) > $timestamp) { + if ($filemtime > $timestamp) { return $this->hash === $this->computeHash(); } } diff --git a/src/Symfony/Component/DependencyInjection/Config/AutowireServiceResource.php b/src/Symfony/Component/DependencyInjection/Config/AutowireServiceResource.php index 0eac93964b94c..2cd1cd1ece204 100644 --- a/src/Symfony/Component/DependencyInjection/Config/AutowireServiceResource.php +++ b/src/Symfony/Component/DependencyInjection/Config/AutowireServiceResource.php @@ -34,12 +34,13 @@ public function __construct($class, $path, array $autowiringMetadata) public function isFresh($timestamp) { - if (!file_exists($this->filePath)) { + $filemtime = @filemtime($this->filePath); + if (!$filemtime) { return false; } // has the file *not* been modified? Definitely fresh - if (@filemtime($this->filePath) <= $timestamp) { + if ($filemtime <= $timestamp) { return true; }