|
@@ -17,6 +17,7 @@ use Composer\Config;
|
|
use Composer\IO\IOInterface;
|
|
use Composer\IO\IOInterface;
|
|
use Composer\Util\ProcessExecutor;
|
|
use Composer\Util\ProcessExecutor;
|
|
use Composer\Util\RemoteFilesystem;
|
|
use Composer\Util\RemoteFilesystem;
|
|
|
|
+use Composer\Util\Filesystem;
|
|
|
|
|
|
/**
|
|
/**
|
|
* A driver implementation for driver with authentication interaction.
|
|
* A driver implementation for driver with authentication interaction.
|
|
@@ -44,11 +45,8 @@ abstract class VcsDriver implements VcsDriverInterface
|
|
*/
|
|
*/
|
|
final public function __construct(array $repoConfig, IOInterface $io, Config $config, ProcessExecutor $process = null, RemoteFilesystem $remoteFilesystem = null)
|
|
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'])
|
|
|
|
- );
|
|
|
|
|
|
+ if (Filesystem::isLocalPath($repoConfig['url'])) {
|
|
|
|
+ $repoConfig['url'] = preg_replace('{^file://}', '', $repoConfig['url']);
|
|
}
|
|
}
|
|
|
|
|
|
$this->url = $repoConfig['url'];
|
|
$this->url = $repoConfig['url'];
|
|
@@ -101,17 +99,6 @@ abstract class VcsDriver implements VcsDriverInterface
|
|
return $this->remoteFilesystem->getContents($this->originUrl, $url, false);
|
|
return $this->remoteFilesystem->getContents($this->originUrl, $url, false);
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * Return if current repository url is local
|
|
|
|
- *
|
|
|
|
- * @param string $url
|
|
|
|
- * @return boolean Repository url is local
|
|
|
|
- */
|
|
|
|
- protected static function isLocalUrl($url)
|
|
|
|
- {
|
|
|
|
- return (bool) preg_match('{^(file://|/|[a-z]:[\\\\/])}i', $url);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* {@inheritDoc}
|
|
* {@inheritDoc}
|
|
*/
|
|
*/
|