Merge pull request #311 from Seldaek/allow_local_fs
Allow local file system git repos & do not restrict to valid http* urlspull/313/merge
commit
3167cccb6f
|
@ -169,6 +169,15 @@ class GitDriver extends VcsDriver implements VcsDriverInterface
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// local filesystem
|
||||||
|
if (preg_match('{^(file://|/|[a-z]:[\\\\/])}', $url)) {
|
||||||
|
$process = new ProcessExecutor();
|
||||||
|
// check whether there is a git repo in that path
|
||||||
|
if ($process->execute(sprintf('cd %s && git show', escapeshellarg($url)), $output) === 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!$deep) {
|
if (!$deep) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,10 +19,6 @@ class VcsRepository extends ArrayRepository
|
||||||
|
|
||||||
public function __construct(array $config, IOInterface $io, array $drivers = null)
|
public function __construct(array $config, IOInterface $io, array $drivers = null)
|
||||||
{
|
{
|
||||||
if (!filter_var($config['url'], FILTER_VALIDATE_URL)) {
|
|
||||||
throw new \UnexpectedValueException('Invalid url given for VCS repository: '.$config['url']);
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->drivers = $drivers ?: array(
|
$this->drivers = $drivers ?: array(
|
||||||
'Composer\Repository\Vcs\GitHubDriver',
|
'Composer\Repository\Vcs\GitHubDriver',
|
||||||
'Composer\Repository\Vcs\GitBitbucketDriver',
|
'Composer\Repository\Vcs\GitBitbucketDriver',
|
||||||
|
|
Loading…
Reference in New Issue