From 6ab6730c326d1116b88416ab8fc5b85b1accfd15 Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Sat, 2 Nov 2013 23:39:26 -0400 Subject: [PATCH] multiple alias support. --- extensions/composer/Installer.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/extensions/composer/Installer.php b/extensions/composer/Installer.php index fb0b683..fbbe329 100644 --- a/extensions/composer/Installer.php +++ b/extensions/composer/Installer.php @@ -90,6 +90,7 @@ class Installer extends LibraryInstaller } $fs = new Filesystem; $vendorDir = $fs->normalizePath($this->vendorDir); + $aliases = []; foreach ($autoload['psr-0'] as $name => $path) { $name = str_replace('\\', '/', trim($name, '\\')); if (!$fs->isAbsolutePath($path)) { @@ -97,11 +98,12 @@ class Installer extends LibraryInstaller } $path = $fs->normalizePath($path); if (strpos($path . '/', $vendorDir . '/') === 0) { - return ["@$name" => '' . substr($path, strlen($vendorDir)) . '/' . $name]; + $aliases["@$name"] = '' . substr($path, strlen($vendorDir)) . '/' . $name; } else { - return ["@$name" => $path . '/' . $name]; + $aliases["@$name"] = $path . '/' . $name; } } + return $aliases; } protected function removePackage(PackageInterface $package)