composer / package-versions-deprecated

:package: Composer addon to efficiently get installed packages' version numbers
MIT License
1.51k stars 9 forks source link

The implementation based on Composer 2 InstalledVersions is broken for the root package #8

Closed stof closed 4 years ago

stof commented 4 years ago

The ocramius/package-versions API supports passing the name of the root package to getVersion (and exposes a constant holding it). The Composer/InstalledVersions API does not support the root package in getVersion (only dependencies are there), but has a separate API to access the info about the root package. But the fallback implementation does not account for it.

Seldaek commented 4 years ago

Yeah 1.10.2 and 1.11.0 need to be backported here it seems.. @nicolas-grekas if you feel like helping out with this again :)

Jean85 commented 4 years ago

2.0 from upstream should totally fix this, but requires Composer 2 :sweat_smile: https://github.com/Ocramius/PackageVersions/pull/155 It should be backported too, it should be the final step of the upgrade path.

Seldaek commented 4 years ago

I guess yeah. The waste of time goes on..

Seldaek commented 4 years ago

About 2.0 I am not 100% sure if it matters, at that point you might as well be using the Composer 2 API directly as 2.0 requires composer 2 anyway..