[autoload] refactor getFullPackage into populateAutoloadInformation

main
Igor Wiedler 13 years ago committed by Jordi Boggiano
parent 9d238330b3
commit aa7c4b8ef7

@ -88,8 +88,10 @@ EOF;
{
$installPaths = array();
foreach ($this->localRepo->getPackages() as $package) {
$this->populateAutoloadInformation($package);
$installPaths[] = array(
$this->getFullPackage($package),
$package,
$this->installationManager->getInstallPath($package)
);
}
@ -115,13 +117,18 @@ EOF;
return $autoloads;
}
private function getFullPackage(PackageInterface $package)
/**
* Because remote repos don't include the autoload data,
* we have to manually fetch it from the locally installed
* packages.
*/
private function populateAutoloadInformation(PackageInterface $package)
{
$path = $this->installationManager->getInstallPath($package);
$loader = new JsonLoader();
$fullPackage = $loader->load(new JsonFile($path.'/composer.json'));
return $fullPackage;
$package->setAutoload($fullPackage->getAutoload());
}
}

Loading…
Cancel
Save