1
0
Fork 0

Show overridden versions (as well as original) in composer show -p

pull/4696/merge
Jordi Boggiano 2016-01-09 17:18:37 +00:00
parent 1a8aedaa9d
commit fd7267e4ad
2 changed files with 9 additions and 3 deletions

View File

@ -84,7 +84,11 @@ EOT
}
// init repos
$platformRepo = new PlatformRepository;
$platformOverrides = array();
if ($composer) {
$platformOverrides = $composer->getConfig()->get('platform') ?: array();
}
$platformRepo = new PlatformRepository(array(), $platformOverrides);
if ($input->getOption('self')) {
$package = $this->getComposer()->getPackage();

View File

@ -58,7 +58,7 @@ class PlatformRepository extends ArrayRepository
$version = $versionParser->normalize($override['version']);
$package = new CompletePackage($override['name'], $version, $override['version']);
$package->setDescription('Overridden virtual platform package '.$override['name']);
$package->setDescription('Package overridden via config.platform');
parent::addPackage($package);
}
@ -82,7 +82,7 @@ class PlatformRepository extends ArrayRepository
if (PHP_INT_SIZE === 8) {
$php64 = new CompletePackage('php-64bit', $version, $prettyVersion);
$php64->setDescription('The PHP interpreter (64bit)');
$php64->setDescription('The PHP interpreter, 64bit');
$this->addPackage($php64);
}
@ -201,6 +201,8 @@ class PlatformRepository extends ArrayRepository
{
// Skip if overridden
if (isset($this->overrides[strtolower($package->getName())])) {
$overrider = $this->findPackage($package->getName(), '*');
$overrider->setDescription($overrider->getDescription().' (actual: '.$package->getPrettyVersion().')');
return;
}
parent::addPackage($package);