Selaa lähdekoodia

Fix realpath() failing on Windows

AnrDaemon 8 vuotta sitten
vanhempi
commit
c774d41a9c
1 muutettua tiedostoa jossa 4 lisäystä ja 2 poistoa
  1. 4 2
      src/Composer/Autoload/AutoloadGenerator.php

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

@@ -99,8 +99,10 @@ class AutoloadGenerator
 
         $filesystem = new Filesystem();
         $filesystem->ensureDirectoryExists($config->get('vendor-dir'));
-        $basePath = $filesystem->normalizePath(realpath(getcwd()));
-        $vendorPath = $filesystem->normalizePath(realpath($config->get('vendor-dir')));
+        // Do not remove double realpath() calls.
+        // Fixes failing Windows realpath() implementation.
+        $basePath = $filesystem->normalizePath(realpath(realpath(getcwd())));
+        $vendorPath = $filesystem->normalizePath(realpath(realpath($config->get('vendor-dir'))));
         $useGlobalIncludePath = (bool) $config->get('use-include-path');
         $prependAutoloader = $config->get('prepend-autoloader') === false ? 'false' : 'true';
         $targetDir = $vendorPath.'/'.$targetDir;