Ignore aliases in autoload generator
parent
35120d7d04
commit
1a255420b0
|
@ -14,6 +14,7 @@ namespace Composer\Autoload;
|
||||||
|
|
||||||
use Composer\Installer\InstallationManager;
|
use Composer\Installer\InstallationManager;
|
||||||
use Composer\Json\JsonFile;
|
use Composer\Json\JsonFile;
|
||||||
|
use Composer\Package\AliasPackage;
|
||||||
use Composer\Package\Loader\JsonLoader;
|
use Composer\Package\Loader\JsonLoader;
|
||||||
use Composer\Package\PackageInterface;
|
use Composer\Package\PackageInterface;
|
||||||
use Composer\Repository\RepositoryInterface;
|
use Composer\Repository\RepositoryInterface;
|
||||||
|
@ -153,6 +154,9 @@ EOF;
|
||||||
$packageMap[] = array($mainPackage, '');
|
$packageMap[] = array($mainPackage, '');
|
||||||
|
|
||||||
foreach ($packages as $package) {
|
foreach ($packages as $package) {
|
||||||
|
if ($package instanceof AliasPackage) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$packageMap[] = array(
|
$packageMap[] = array(
|
||||||
$package,
|
$package,
|
||||||
$installationManager->getInstallPath($package)
|
$installationManager->getInstallPath($package)
|
||||||
|
|
|
@ -14,6 +14,7 @@ namespace Composer\Test\Autoload;
|
||||||
|
|
||||||
use Composer\Autoload\AutoloadGenerator;
|
use Composer\Autoload\AutoloadGenerator;
|
||||||
use Composer\Util\Filesystem;
|
use Composer\Util\Filesystem;
|
||||||
|
use Composer\Package\AliasPackage;
|
||||||
use Composer\Package\MemoryPackage;
|
use Composer\Package\MemoryPackage;
|
||||||
use Composer\Test\TestCase;
|
use Composer\Test\TestCase;
|
||||||
|
|
||||||
|
@ -164,6 +165,7 @@ class AutoloadGeneratorTest extends TestCase
|
||||||
$packages = array();
|
$packages = array();
|
||||||
$packages[] = $a = new MemoryPackage('a/a', '1.0', '1.0');
|
$packages[] = $a = new MemoryPackage('a/a', '1.0', '1.0');
|
||||||
$packages[] = $b = new MemoryPackage('b/b', '1.0', '1.0');
|
$packages[] = $b = new MemoryPackage('b/b', '1.0', '1.0');
|
||||||
|
$packages[] = $c = new AliasPackage($b, '1.2', '1.2');
|
||||||
$a->setAutoload(array('psr-0' => array('A' => 'src/', 'A\\B' => 'lib/')));
|
$a->setAutoload(array('psr-0' => array('A' => 'src/', 'A\\B' => 'lib/')));
|
||||||
$b->setAutoload(array('psr-0' => array('B\\Sub\\Name' => 'src/')));
|
$b->setAutoload(array('psr-0' => array('B\\Sub\\Name' => 'src/')));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue