Sfoglia il codice sorgente

Make sure custom vendor paths don't break file autoloading

Nils Adermann 12 anni fa
parent
commit
4e9e66a957
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      src/Composer/Autoload/AutoloadGenerator.php

+ 2 - 2
src/Composer/Autoload/AutoloadGenerator.php

@@ -127,8 +127,8 @@ EOF;
         $filesCode = "";
         $autoloads['files'] = new \RecursiveIteratorIterator(new \RecursiveArrayIterator($autoloads['files']));
         foreach ($autoloads['files'] as $functionFile) {
-            if ( ! $filesystem->isAbsolutePath($functionFile)) {
-                $functionFile = dirname($vendorPath) . '/'. $functionFile;
+            if (!$filesystem->isAbsolutePath($functionFile)) {
+                $functionFile = getcwd() . '/'. $functionFile;
             }
 
             $filesCode .= '    require __DIR__ . '. var_export('/'.$filesystem->findShortestPath($vendorPath, $functionFile), true).";\n";