-
-
Notifications
You must be signed in to change notification settings - Fork 254
Add support for Composer version 2 #309
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
Conversation
Composer version 2 has `composer-plugin-api` version 2. This PR updates the version constraint to `^1 || ^2` so we can support both composer versions. See [What's new in Composer 2](https://php.watch/articles/composer-2) and [UPGRADE-2.0](https://github.com/composer/composer/blob/master/UPGRADE-2.0.md#for-integrators-and-plugin-authors) for more changes in API. Empty methods \cweagans\Composer\Plugin\Patches::deactivate() and \cweagans\Composer\Plugin\Patches::uninstall are added to make it compatible both versions.
|
Thanks for this! I'm going to hold off on merging this for the time being, since the plugin won't actually work in Composer 2 with this PR. If you don't mind, I'll build off of this once I have some time and then get it merged in! |
|
Thanks @cweagans for your time. May I ask what is broken with Composer 2? It took me some fiddling, but I could get the plugin to work with composer 2. I didn't make extensive tests with exclusion patterns and separate patch files, but my package was indeed patched when downloaded. Because this plugin depends on another library that brings the configuration trait, I had to add these two got repos as path repos in the test project composer.json, so they are loaded from my forks instead of the upstream. If there's anything I can help, I'd be eager to work on them. But of course please take time. Thank you. |
|
This plugin is such a corner stone in most of our projects, that I'd be glad to sponsor some development time if it allows you to release a version that is compatible with composer v2 |
|
@CDRO there is already a release. 1.7.0 |
|
Ah yes, thanks for pointing that out, sometimes I should wait for the second coffee to kick in before asking a question :-) |
Hi Cameron,
Composer 2 is about to be released, and it has
composer-plugin-apiversion 2. This PR updates the version constraint incomposer.jsonto^1 || ^2so we can support both composer versions.See What's new in Composer 2 and UPGRADE-2.0 for more changes in API. Empty methods \cweagans\Composer\Plugin\Patches::deactivate() and \cweagans\Composer\Plugin\Patches::uninstall are added to make it compatible both versions.
I will make a PR to the
cweagans/composer-configurable-pluginto update itscomposer/composerversion constraint because this package depends on it.Related: composer/composer#8726
Thank you 🙏.