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

Update to support Composer 2.0 #50

Open
robbieaverill opened this issue Oct 27, 2020 · 4 comments
Open

Update to support Composer 2.0 #50

robbieaverill opened this issue Oct 27, 2020 · 4 comments

Comments

@robbieaverill
Copy link
Contributor

robbieaverill commented Oct 27, 2020

We are using Composer's API to process a project's dependency list. Composer 2.0 is now available, and part of this is:

There is a new class, Composer\InstalledVersions, which is autoloaded in every project and is available at runtime. It allows you to check which packages/versions are present at runtime of your own project.

If nothing else this will simplify this module - in theory we can use this class to access the information we're currently building semi-manually with the Composer API.

@GuySartorelli
Copy link
Collaborator

If your code relies on any of these runtime features, you should require "composer-runtime-api": "^2.0" in your composer.json. This is a virtual package which is provided by Composer and will make sure people have to use Composer 2.x to install your package.

Considering Silverstripe Cloud and Public Sector still (afaik) use composer 1, is this a change that would be okay to make?

@GuySartorelli
Copy link
Collaborator

If nothing else this will simplify this module - in theory we can use this class to access the information we're currently building semi-manually with the Composer API.

It turns out all this gives you is the currently installed version (which we could just fetch from composer.lock anyway) - it doesn't provide the contraints enforced by dependent packages.

@GuySartorelli
Copy link
Collaborator

Will be resolved by #62

@GuySartorelli
Copy link
Collaborator

The new major version uses composer 2. This ticket should be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants