Skip to content
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

Use proper way to retrieve the Composer version #92

Merged
merged 3 commits into from
May 13, 2022

Conversation

Seldaek
Copy link
Contributor

@Seldaek Seldaek commented Mar 2, 2022

Fixes #81

@peterjaap
Copy link
Contributor

@zamoroka while you're merging, can you do this one as well? :)

@zamoroka
Copy link
Contributor

Hi @Seldaek , @peterjaap
The \Composer\Composer::getVersion() was introduced in composer 1.8.5 which means that we need to drop support of all previous releases

@peterjaap
Copy link
Contributor

Since 1.8.5 was released in april 2019 and Composer 1 is on it's way out, I'd be perfectly fine with that.

@zamoroka
Copy link
Contributor

@Seldaek could you please add the min composer version in composer.json?

        "composer-plugin-api": "^1.8.5 || ^2.0",

@Seldaek
Copy link
Contributor Author

Seldaek commented May 13, 2022

There is no way to do this unfortunately as the plugin-api is stuck at 1.1.0 on Composer 1.

Either we require composer-runtime-api: ^1 || ^2 which will force Composer 1.10.6+ or 2.0+, or we leave it as is and probably it'll be fine.

From my stats I see 1-2% of installs coming from Composer versions older than 1.8.5 so I think it's fairly irrelevant, those are unlikely to be updating packages anyway..

@zamoroka
Copy link
Contributor

zamoroka commented May 13, 2022

@Seldaek I think adding

  "composer/composer": ">=1.8.5"

to the "require" section could do the trick

@Seldaek
Copy link
Contributor Author

Seldaek commented May 13, 2022

Nope this is a bad idea as it'd add composer in the vendor dir, and not actually fix anything. Your options are what I said above, or if you want to absolutely support everything add a method_exists call before using getVersion?

@zamoroka
Copy link
Contributor

ok, let then go with composer-runtime-api: ^1 || ^2 option.
Thanks for your comments

@Seldaek
Copy link
Contributor Author

Seldaek commented May 13, 2022

Yeah I think this makes the most sense, anyone stuck on an old composer will then remain on the previous version of the plugin, no big deal.

@Seldaek
Copy link
Contributor Author

Seldaek commented May 13, 2022

OK good to go then I think.

@zamoroka zamoroka merged commit 24169a0 into vaimo:master May 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Composer 2.1-dev FileDownloader
3 participants