-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DI] Fix Preload #34833
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DI] Fix Preload #34833
Conversation
I think #34757 fixed the issue already. |
Wouldn't this cause issues in case multiple Composer class loaders are registered in memory at the time the container is dumped ? This could happen for instance if you run Behat from a phar (which uses the composer ClassLoader inside the phar) or a global composer install (or whatever else custom install also using composer) and the Behat run has to refresh the container cache. This might also happen when using simple-phpunit rather than Behat btw, because it also uses a composer-based installation for PHPUnit but independent from the vendor folder |
@nicolas-grekas do we have a test asserting the output of the dumper for the preload.php file ? |
@stof yes we do |
Ohh indeed, My Patch was totally wrong, because the issue was somewhere else when project is installed in I update the patch according to the original issue |
@@ -209,7 +209,7 @@ public function dump(array $options = []) | |||
|
|||
if (3 <= $i) { | |||
$regex = ''; | |||
$lastOptionalDir = $i > 8 ? $i - 5 : 3; | |||
$lastOptionalDir = $i > 8 ? $i - 5 : $i - 3; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3 is var
, cache
, env
I don't get why the projet dir + parent dir are optionnal when the path contains more than 8 directories
fixed by #34757 |
The regexp to targetDir was malformatted when the number of folder was lower than 8
Here is the value of Regexp.