Skip to content

Commit

Permalink
bug #32579 [Config] Do not use absolute path when computing the vendo…
Browse files Browse the repository at this point in the history
…r freshness (lyrixx)

This PR was merged into the 3.4 branch.

Discussion
----------

[Config] Do not use absolute path when computing the vendor freshness

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

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.

Commits
-------

2d2e274 [Config] Do not use absolute path when computing the vendor freshness
  • Loading branch information
nicolas-grekas committed Jul 18, 2019
2 parents 0487e10 + 2d2e274 commit 54c77e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Symfony/Component/Config/Resource/ComposerResource.php
Expand Up @@ -48,7 +48,7 @@ public function isFresh($timestamp)
{
self::refresh();

return self::$runtimeVendors === $this->vendors;
return array_values(self::$runtimeVendors) === array_values($this->vendors);
}

/**
Expand Down

0 comments on commit 54c77e6

Please sign in to comment.