From a834efe7c98808fa82e0f5b73522c4c556c726e5 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 27 Jul 2012 09:03:25 -0500 Subject: [PATCH 1/2] Fix directory handling when auto-loading files. --- src/Composer/Autoload/AutoloadGenerator.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Composer/Autoload/AutoloadGenerator.php b/src/Composer/Autoload/AutoloadGenerator.php index 5c6de01b0..99fc35ca6 100644 --- a/src/Composer/Autoload/AutoloadGenerator.php +++ b/src/Composer/Autoload/AutoloadGenerator.php @@ -127,11 +127,7 @@ EOF; $filesCode = ""; $autoloads['files'] = new \RecursiveIteratorIterator(new \RecursiveArrayIterator($autoloads['files'])); foreach ($autoloads['files'] as $functionFile) { - if (!$filesystem->isAbsolutePath($functionFile)) { - $functionFile = getcwd() . '/'. $functionFile; - } - - $filesCode .= ' require __DIR__ . '. var_export('/'.$filesystem->findShortestPath($vendorPath, $functionFile), true).";\n"; + $filesCode .= ' require '.$this->getPathCode($filesystem, $relVendorPath, $vendorPath, $functionFile).";\n"; } file_put_contents($targetDir.'/autoload_namespaces.php', $namespacesFile); From 8cf43868da80a391efbbe38099e8e25b69386425 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 27 Jul 2012 09:13:39 -0500 Subject: [PATCH 2/2] update tests for new expectations. --- tests/Composer/Test/Autoload/Fixtures/autoload_functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Composer/Test/Autoload/Fixtures/autoload_functions.php b/tests/Composer/Test/Autoload/Fixtures/autoload_functions.php index 610b4aff1..f39eb8a33 100644 --- a/tests/Composer/Test/Autoload/Fixtures/autoload_functions.php +++ b/tests/Composer/Test/Autoload/Fixtures/autoload_functions.php @@ -21,8 +21,8 @@ return call_user_func(function() { $loader->register(); - require __DIR__ . '/a/a/test.php'; - require __DIR__ . '/b/b/test2.php'; + require $vendorDir . '/a/a/test.php'; + require $vendorDir . '/b/b/test2.php'; return $loader; });