Browse Source

Support windows local paths

Jordi Boggiano 13 years ago
parent
commit
30d4080014
1 changed files with 7 additions and 4 deletions
  1. 7 4
      src/Composer/Repository/Vcs/SvnDriver.php

+ 7 - 4
src/Composer/Repository/Vcs/SvnDriver.php

@@ -14,6 +14,7 @@ namespace Composer\Repository\Vcs;
 
 use Composer\Json\JsonFile;
 use Composer\Util\ProcessExecutor;
+use Composer\Util\Filesystem;
 use Composer\Util\Svn as SvnUtil;
 use Composer\IO\IOInterface;
 
@@ -64,7 +65,7 @@ class SvnDriver extends VcsDriver
      */
     public function __construct($url, IOInterface $io, ProcessExecutor $process = null)
     {
-        $url = self::fixSvnUrl($url);
+        $url = self::normalizeUrl($url);
         parent::__construct($this->baseUrl = rtrim($url, '/'), $io, $process);
 
         if (false !== ($pos = strrpos($url, '/trunk'))) {
@@ -298,11 +299,13 @@ class SvnDriver extends VcsDriver
      *
      * @return string
      */
-    protected static function fixSvnUrl($url)
+    protected static function normalizeUrl($url)
     {
-        if (strpos($url, '/', 0) === 0) {
-            $url = 'file://' . $url;
+        $fs = new Filesystem();
+        if ($fs->isAbsolutePath($url)) {
+            return 'file://' . strtr($url, '\\', '/');
         }
+
         return $url;
     }
 }