-
Notifications
You must be signed in to change notification settings - Fork 41
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
How to patch a package from another? #13
Comments
the format for adding patches into a package is exactly the same that you'd use in root composer.json. So in your case package B would have this: {
"extra": {
"patches": {
"A": {
"Compatibility: required change to create magic": "patches/compatibility-with-dependency-a.patch"
}
}
}
} ... where you'd have /patches/compatibility-with-dependency-a.patch and paths in patch are relative to the root of package A. Note that you can test it out if you have the composer-patches module installed and execute... composer patch --redo --from-source --filter compatibility-with-dependency-a The 'filter' part is really optional as you could also try to re-apply everything. the 'from-source' makes the patches scan for patches directly in 'vendor' folder (which allows patches to be pre-tested before [updating/commiting changes to] a given package). The default behaviour is to scan for them in installed.json |
Thanks for your quick answer, works like a charm! Could it also be added to the documentation, please? :) |
I'm glad that you got it working :) Added this Q/A as an example to the readme + clarified where the definition format can be used @ 554abba |
I have a root composer.json which requires two packages, and package B depends on (requires) package A. In order to be able to use package B properly, package A needs to be patched.
How to instruct vaimo/composer-patches from package B's composer.json to patch package A? It would be the best if the root composer.json wouldn't contain these instructions.
The text was updated successfully, but these errors were encountered: