From 30d408001446c7a21b17bc67b783dda490542fe2 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sat, 24 Mar 2012 23:19:11 +0100 Subject: [PATCH] Support windows local paths --- src/Composer/Repository/Vcs/SvnDriver.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Composer/Repository/Vcs/SvnDriver.php b/src/Composer/Repository/Vcs/SvnDriver.php index 1183229dd..631058234 100644 --- a/src/Composer/Repository/Vcs/SvnDriver.php +++ b/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; } }