1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-10 09:02:59 +00:00

Only list tree of packages required by root and not every installed package individually, refs #2600

This commit is contained in:
Jordi Boggiano 2015-11-27 10:28:57 +00:00
parent e6e636802f
commit 9b8a14179b

View file

@ -152,8 +152,16 @@ EOT
return 1;
}
$rootPackage = $this->getComposer()->getPackage();
$rootRequires = array_map(
'strtolower',
array_keys(array_merge($rootPackage->getRequires(), $rootPackage->getDevRequires()))
);
foreach ($installedRepo->getPackages() as $package) {
$this->displayPackageTree($package, $installedRepo, $repos, $output);
if (in_array($package->getName(), $rootRequires, true)) {
$this->displayPackageTree($package, $installedRepo, $repos, $output);
}
}
return 0;