1
0
Fork 0

Ignore aliases in autoload generator

pull/695/head
Jordi Boggiano 2012-05-14 14:01:37 +02:00
parent 35120d7d04
commit 1a255420b0
2 changed files with 6 additions and 0 deletions

View File

@ -14,6 +14,7 @@ namespace Composer\Autoload;
use Composer\Installer\InstallationManager;
use Composer\Json\JsonFile;
use Composer\Package\AliasPackage;
use Composer\Package\Loader\JsonLoader;
use Composer\Package\PackageInterface;
use Composer\Repository\RepositoryInterface;
@ -153,6 +154,9 @@ EOF;
$packageMap[] = array($mainPackage, '');
foreach ($packages as $package) {
if ($package instanceof AliasPackage) {
continue;
}
$packageMap[] = array(
$package,
$installationManager->getInstallPath($package)

View File

@ -14,6 +14,7 @@ namespace Composer\Test\Autoload;
use Composer\Autoload\AutoloadGenerator;
use Composer\Util\Filesystem;
use Composer\Package\AliasPackage;
use Composer\Package\MemoryPackage;
use Composer\Test\TestCase;
@ -164,6 +165,7 @@ class AutoloadGeneratorTest extends TestCase
$packages = array();
$packages[] = $a = new MemoryPackage('a/a', '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/')));
$b->setAutoload(array('psr-0' => array('B\\Sub\\Name' => 'src/')));