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

Add support for composer-plugin-api v2 #85

Merged
merged 1 commit into from
May 30, 2020
Merged

Add support for composer-plugin-api v2 #85

merged 1 commit into from
May 30, 2020

Conversation

Ayesh
Copy link
Contributor

@Ayesh Ayesh commented Apr 15, 2020

Composer version 2 has composer-plugin-api version 2, and this plugin attemts to support both API versions.

See What's new in Composer 2 and UPGRADE-2.0 for more changes in API.

  • Empty methods \Symfony\Thanks\Thanks::deactivate() and \Symfony\Thanks\Thanks::uninstall() are added to make it compatible both versions.
  • On Composer v2, \Hirak\Prestissimo\CurlRemoteFilesystem is not used in favor of Composer's native \Composer\Util\HttpDownloader which make multiple Curl connections.

Related: #84 and composer/composer#8726.

thanks 🙏

@nicolas-grekas
Copy link
Member

Thanks for working on this :)

Due to internal changes in the package downloading components, we cannot support both composer-plugin-api v1 and v2 in the same package.

Is there really nothing we can do? What are the exact blockers?

@Ayesh
Copy link
Contributor Author

Ayesh commented Apr 15, 2020

Thanks for the quick reply @nicolas-grekas :)

Composer v2 has a HttpDownloader class that is not available in v1. However, we have access to the Composer object and its version, so I will work on a workaround to branch the approaches, so it's compatible with both versions.

@Ayesh
Copy link
Contributor Author

Ayesh commented Apr 15, 2020

@nicolas-grekas - I force-pushed a new update commit that supports both composer API versions. Composer::getVersion() returns the composer version number, and we simply branch the code depending on the version. I tested with current Composer snapshot and 1.10.5 and.

Thank you.

src/GitHubClient.php Outdated Show resolved Hide resolved
src/GitHubClient.php Outdated Show resolved Hide resolved
Copy link

@miloshavlicek miloshavlicek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to be ok.

Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed some changes before merging.

@nicolas-grekas
Copy link
Member

Thank you @Ayesh.

@nicolas-grekas nicolas-grekas merged commit 6e86a8d into symfony:master May 30, 2020
@nicolas-grekas
Copy link
Member

Tagged as v1.2.6

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.

4 participants