From c774d41a9cab65512f413d0d35201d592620dd93 Mon Sep 17 00:00:00 2001 From: AnrDaemon Date: Thu, 29 Sep 2016 08:05:55 +0200 Subject: [PATCH] Fix realpath() failing on Windows --- src/Composer/Autoload/AutoloadGenerator.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Composer/Autoload/AutoloadGenerator.php b/src/Composer/Autoload/AutoloadGenerator.php index 2a66a4bf6..95bab637e 100644 --- a/src/Composer/Autoload/AutoloadGenerator.php +++ b/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;