1
0
Fork 0

Merge branch '1.7'

pull/7534/head
Jordi Boggiano 2018-08-04 17:44:30 +02:00
commit 7ea15eec6c
1 changed files with 7 additions and 8 deletions

View File

@ -157,7 +157,7 @@ EOF;
// Collect information from all packages.
$packageMap = $this->buildPackageMap($installationManager, $mainPackage, $localRepo->getCanonicalPackages());
$autoloads = $this->parseAutoloads($packageMap, $mainPackage);
$autoloads = $this->parseAutoloads($packageMap, $mainPackage, $this->devMode === false);
// Process the 'psr-0' base directories.
foreach ($autoloads['psr-0'] as $namespace => $paths) {
@ -383,12 +383,15 @@ EOF;
*
* @param array $packageMap array of array(package, installDir-relative-to-composer.json)
* @param PackageInterface $mainPackage root package instance
* @param bool $filterOutRequireDevPackages whether to filter out require-dev packages
* @return array array('psr-0' => array('Ns\\Foo' => array('installDir')))
*/
public function parseAutoloads(array $packageMap, PackageInterface $mainPackage)
public function parseAutoloads(array $packageMap, PackageInterface $mainPackage, $filterOutRequireDevPackages = false)
{
$mainPackageMap = array_shift($packageMap);
if ($filterOutRequireDevPackages) {
$packageMap = $this->filterPackageMap($packageMap, $mainPackage);
}
$sortedPackageMap = $this->sortPackageMap($packageMap);
$sortedPackageMap[] = $mainPackageMap;
array_unshift($packageMap, $mainPackageMap);
@ -901,7 +904,7 @@ INITIALIZER;
}
/**
* Filters out dev-dependencies when not in dev-mode
* Filters out dev-dependencies
*
* @param array $packageMap
* @param PackageInterface $mainPackage
@ -909,10 +912,6 @@ INITIALIZER;
*/
protected function filterPackageMap(array $packageMap, PackageInterface $mainPackage)
{
if ($this->devMode === true) {
return $packageMap;
}
$packages = array();
$include = array();