Install/Uninstall packages in pre/post install/update event script #11841
-
As part of a private project, I merged various internal composer libraries into a singular I had the idea of using the I was able to get both approaches somewhat working by creating either So I guess in short, is there a better way to go about installing/uninstalling packages within an install/update hook that accounts for dependencies? Or alternatively, allow mutating the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I think it'd be much easier to use But that sounds to me tricky and dangerous as you may mess things up. I think I'd rather live with a few extra deps installed if I were you. |
Beta Was this translation helpful? Give feedback.
I think it'd be much easier to use
replace
to eliminate packages, like what is described as "Composer replace option" on this blog post for polyfills https://php.watch/articles/composer-replace-polyfills - that'd allow you from your root project to get rid of some sub-components you do not want.But that sounds to me tricky and dangerous as you may mess things up. I think I'd rather live with a few extra deps installed if I were you.