Extract some code in a AutoloadGenerator::buildPackageMap method
parent
8c535b1961
commit
5daaba9e62
|
@ -68,19 +68,7 @@ return array(
|
|||
|
||||
EOF;
|
||||
|
||||
// build package => install path map
|
||||
$packageMap = array();
|
||||
|
||||
// add main package
|
||||
$packageMap[] = array($mainPackage, '');
|
||||
|
||||
foreach ($localRepo->getPackages() as $installedPackage) {
|
||||
$packageMap[] = array(
|
||||
$installedPackage,
|
||||
$installationManager->getInstallPath($installedPackage)
|
||||
);
|
||||
}
|
||||
|
||||
$packageMap = $this->buildPackageMap($installationManager, $mainPackage, $localRepo->getPackages());
|
||||
$autoloads = $this->parseAutoloads($packageMap);
|
||||
|
||||
$appBaseDir = $filesystem->findShortestPathCode($vendorPath, getcwd(), true);
|
||||
|
@ -128,6 +116,24 @@ EOF;
|
|||
copy(__DIR__.'/ClassLoader.php', $targetDir.'/ClassLoader.php');
|
||||
}
|
||||
|
||||
public function buildPackageMap(InstallationManager $installationManager, PackageInterface $mainPackage, array $packages)
|
||||
{
|
||||
// build package => install path map
|
||||
$packageMap = array();
|
||||
|
||||
// add main package
|
||||
$packageMap[] = array($mainPackage, '');
|
||||
|
||||
foreach ($packages as $package) {
|
||||
$packageMap[] = array(
|
||||
$package,
|
||||
$installationManager->getInstallPath($package)
|
||||
);
|
||||
}
|
||||
|
||||
return $packageMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compiles an ordered list of namespace => path mappings
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue