1
0
Fork 0

Fix 'composer show --platform <package>' erroring if no composer.json is present (#11533)

Sort of related to #11046 (although this is not a regression, but didn't work before, either)
pull/11920/head
David Zülke 2023-07-21 11:28:36 +02:00 committed by Jordi Boggiano
parent 008c8ed11a
commit 2feeb56477
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 2 additions and 2 deletions

View File

@ -699,7 +699,7 @@ EOT
$io->write('<info>homepage</info> : ' . $package->getHomepage()); $io->write('<info>homepage</info> : ' . $package->getHomepage());
$io->write('<info>source</info> : ' . sprintf('[%s] <comment>%s</comment> %s', $package->getSourceType(), $package->getSourceUrl(), $package->getSourceReference())); $io->write('<info>source</info> : ' . sprintf('[%s] <comment>%s</comment> %s', $package->getSourceType(), $package->getSourceUrl(), $package->getSourceReference()));
$io->write('<info>dist</info> : ' . sprintf('[%s] <comment>%s</comment> %s', $package->getDistType(), $package->getDistUrl(), $package->getDistReference())); $io->write('<info>dist</info> : ' . sprintf('[%s] <comment>%s</comment> %s', $package->getDistType(), $package->getDistUrl(), $package->getDistReference()));
if ($installedRepo->hasPackage($package)) { if (!PlatformRepository::isPlatformPackage($package->getName()) && $installedRepo->hasPackage($package)) {
$io->write('<info>path</info> : ' . sprintf('%s', realpath($this->getComposer()->getInstallationManager()->getInstallPath($package)))); $io->write('<info>path</info> : ' . sprintf('%s', realpath($this->getComposer()->getInstallationManager()->getInstallPath($package))));
} }
$io->write('<info>names</info> : ' . implode(', ', $package->getNames())); $io->write('<info>names</info> : ' . implode(', ', $package->getNames()));
@ -864,7 +864,7 @@ EOT
); );
} }
if ($installedRepo->hasPackage($package)) { if (!PlatformRepository::isPlatformPackage($package->getName()) && $installedRepo->hasPackage($package)) {
$json['path'] = realpath($this->getComposer()->getInstallationManager()->getInstallPath($package)); $json['path'] = realpath($this->getComposer()->getInstallationManager()->getInstallPath($package));
if ($json['path'] === false) { if ($json['path'] === false) {
unset($json['path']); unset($json['path']);