From fd7267e4ad9e4c992916df02e85247bf686844e5 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sat, 9 Jan 2016 17:18:37 +0000 Subject: [PATCH] Show overridden versions (as well as original) in composer show -p --- src/Composer/Command/ShowCommand.php | 6 +++++- src/Composer/Repository/PlatformRepository.php | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Composer/Command/ShowCommand.php b/src/Composer/Command/ShowCommand.php index 76ca2f6a4..7704e09fb 100644 --- a/src/Composer/Command/ShowCommand.php +++ b/src/Composer/Command/ShowCommand.php @@ -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(); diff --git a/src/Composer/Repository/PlatformRepository.php b/src/Composer/Repository/PlatformRepository.php index 44a70b83b..084bc2af7 100644 --- a/src/Composer/Repository/PlatformRepository.php +++ b/src/Composer/Repository/PlatformRepository.php @@ -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);