浏览代码

Merge pull request #1950 from rovangju/master

Added realpath to VcsDriver constructor to address issues with relative file paths...
Jordi Boggiano 12 年之前
父节点
当前提交
c0679232e2
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      src/Composer/Repository/Vcs/VcsDriver.php

+ 7 - 0
src/Composer/Repository/Vcs/VcsDriver.php

@@ -44,6 +44,13 @@ abstract class VcsDriver implements VcsDriverInterface
      */
     final public function __construct(array $repoConfig, IOInterface $io, Config $config, ProcessExecutor $process = null, RemoteFilesystem $remoteFilesystem = null)
     {
+        
+        if (self::isLocalUrl($repoConfig['url'])) {
+            $repoConfig['url'] = realpath(
+                preg_replace('/^file:\/\//', '', $repoConfig['url'])
+            );
+        }
+        
         $this->url = $repoConfig['url'];
         $this->originUrl = $repoConfig['url'];
         $this->repoConfig = $repoConfig;