symfony / flex

Composer plugin for Symfony
MIT License
4.15k stars 181 forks source link

[Bug] Fix Flex not installing recipes while it is being upgraded #978

Closed weaverryan closed 10 months ago

weaverryan commented 1 year ago

Fixes #977

Here's the lifecycle:

A) Packages are installed/updated and Flex::recordOperations() is called. B) Composer sees that symfony/flex is updated and unloads the plugin and reloads it under a new Symfony\Flex\Flex_composer_tmp0 class. This results in the Flex::$operations property being lost. C) And so, no recipes are installed.

This PR "stashes" the operations directly on Symfony/Flex/Flex where we then read them later. Tested locally. Amazing, it seems to work perfectly.

Also, backports #976 to 1.x - my fault for making the PR on the wrong branch.

Cheers!

fabpot commented 1 year ago

Is it only for 2.x or also for 1.x?

weaverryan commented 1 year ago

Is it only for 2.x or also for 1.x?

Also in 1.x. My mistake - I updated the branch target - thanks for catching that.

weaverryan commented 1 year ago

This should be ready to go

fabpot commented 10 months ago

Thank you @weaverryan.