-
-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Support for Versions::ROOT_PACKAGE_NAME is broken #148
Comments
sure. But in the meantime, it should still work. for now, there is no way to get the info about the root package anymore in this library. |
Hmm, wait, so |
|
I see, makes sense. Will indeed need some trickery to work :-\ |
Well, I think this could look like this: function getVersion(string $packageName)
{
if ($packageName === self::ROOT_PACKAGE_NAME) {
return \Composer\InstalledVersions::getRootPackage()['version']; // Or whatever is needed to output the right info
}
// existing code stays here
} |
This seems to be only affecting the "fallback" version, when |
…h `--no-scripts` The root package version, when running with a stub version of `PackageVersions\Versions` (which happens when installation was run with `--no-scripts` or equivalent), uses a string that is not recognized by Composer's `composer-runtime-api` tooling: for that special case, we compare it to the default version that is stored in the constant, and use composer's tooling to figure out the actual root package version
…name-version #148 retrieve root package version also when package is installed with `--no-scripts`
Versions::getVersion(Versions::ROOT_PACKAGE_NAME)
is expected to return the version of the root package.But currently, the implementation forwards such call to
Composer\InstalledVersions::getVersion()
directly, which does not support the root package as package name. Info about the root package is exposed throughComposer\InstalledVersions::getRootPackage()
The text was updated successfully, but these errors were encountered: