From 8180117584d91fbb8d15067dc935b9979682326b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Bj=C3=B8rnskov?= Date: Mon, 7 Nov 2011 09:28:48 +0100 Subject: [PATCH] AutoloadGenerator.php miscalculates the path Add tenary check to make sure relative specified paths arent seen as absolute. Fixises #94 --- src/Composer/Autoload/AutoloadGenerator.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Composer/Autoload/AutoloadGenerator.php b/src/Composer/Autoload/AutoloadGenerator.php index d075da6d7..88bf58a0f 100644 --- a/src/Composer/Autoload/AutoloadGenerator.php +++ b/src/Composer/Autoload/AutoloadGenerator.php @@ -111,11 +111,12 @@ EOF; foreach ($package->getAutoload() as $type => $mapping) { foreach ($mapping as $namespace => $path) { $autoloads[$type][] = array( - 'namespace' => $namespace, - 'path' => $installPath.'/'.$path, + 'namespace' => $namespace, + 'path' => empty($installPath) ? $path : $installPath.'/'.$path, ); } } + } foreach ($autoloads as $type => $maps) {