From 2d2e2742c82189711d5994ae16f0910818dba0a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Wed, 17 Jul 2019 17:23:18 +0200 Subject: [PATCH] [Config] Do not use absolute path when computing the vendor freshness When one uses Docker with a different mounting point between CLI & FPM, the cache keeps regenerating because the ComposerResource class see a different path for each SAPI. For example `/home/app/app/vendor` vs `/var/www/app/vendor`. So if you hit FPM, then the CLI, then FPM, each time a new cache is generated. So the application is quite slow in dev env. And for people on MacOSX (with docker) is a big pain! And obvisouly, this never stabilizes ! This occurs a lot when you have a worker, that crash and reboot in the background, and you browse the web interface. Or when you have something that hit your API every X secondes, and you are working on a worker. --- src/Symfony/Component/Config/Resource/ComposerResource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Config/Resource/ComposerResource.php b/src/Symfony/Component/Config/Resource/ComposerResource.php index c826d1bb75127..9fb304bea8f06 100644 --- a/src/Symfony/Component/Config/Resource/ComposerResource.php +++ b/src/Symfony/Component/Config/Resource/ComposerResource.php @@ -48,7 +48,7 @@ public function isFresh($timestamp) { self::refresh(); - return self::$runtimeVendors === $this->vendors; + return array_values(self::$runtimeVendors) === array_values($this->vendors); } /**