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
parent
008c8ed11a
commit
2feeb56477
|
@ -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']);
|
||||||
|
|
Loading…
Reference in New Issue