mirror of
https://github.com/composer/composer
synced 2025-05-11 09:32:55 +00:00
Optimize show -a by loading only the requested package (#11659)
Fixes #11648
This commit is contained in:
parent
c7e696dbde
commit
892eaacedf
5 changed files with 59 additions and 13 deletions
|
@ -367,12 +367,18 @@ class RepositorySet
|
|||
{
|
||||
$request = new Request($lockedRepo);
|
||||
|
||||
$allowedPackages = [];
|
||||
foreach ($packageNames as $packageName) {
|
||||
if (PlatformRepository::isPlatformPackage($packageName)) {
|
||||
throw new \LogicException('createPoolForPackage(s) can not be used for platform packages, as they are never loaded by the PoolBuilder which expects them to be fixed. Use createPoolWithAllPackages or pass in a proper request with the platform packages you need fixed in it.');
|
||||
}
|
||||
|
||||
$request->requireName($packageName);
|
||||
$allowedPackages[] = strtolower($packageName);
|
||||
}
|
||||
|
||||
if (count($allowedPackages) > 0) {
|
||||
$request->restrictPackages($allowedPackages);
|
||||
}
|
||||
|
||||
return $this->createPool($request, new NullIO());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue