mirror of
https://github.com/composer/composer
synced 2025-05-10 00:53:06 +00:00
Merge pull request #1015 from Seldaek/memory
Reduce memory usage by only loading packages that are actually needed, fixes #456
This commit is contained in:
commit
01593e0628
41 changed files with 1262 additions and 704 deletions
|
@ -271,13 +271,12 @@ EOT
|
|||
}
|
||||
|
||||
$token = strtolower($name);
|
||||
foreach ($this->repos->getPackages() as $package) {
|
||||
if (false === ($pos = strpos($package->getName(), $token))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$packages[] = $package;
|
||||
}
|
||||
$this->repos->filterPackages(function ($package) use ($token, &$packages) {
|
||||
if (false !== strpos($package->getName(), $token)) {
|
||||
$packages[] = $package;
|
||||
}
|
||||
});
|
||||
|
||||
return $packages;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue