1
0
Fork 0
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:
Nils Adermann 2012-08-24 11:32:33 -07:00
commit 01593e0628
41 changed files with 1262 additions and 704 deletions

View file

@ -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;
}