1
0
Fork 0

Merge pull request #154 from webfactory/fix_driver_detection

Fix driver detection
pull/108/merge
Jordi Boggiano 2011-12-12 03:40:28 -08:00
commit 82a2a1f7ac
3 changed files with 6 additions and 6 deletions

View File

@ -26,7 +26,8 @@ class ComposerRepository extends ArrayRepository
public function __construct(array $config) public function __construct(array $config)
{ {
if (!preg_match('{^https?://}', $config['url'])) { if (!preg_match('{^\w+://}', $config['url'])) {
// assume http as the default protocol
$config['url'] = 'http://'.$config['url']; $config['url'] = 'http://'.$config['url'];
} }
$config['url'] = rtrim($config['url'], '/'); $config['url'] = rtrim($config['url'], '/');

View File

@ -180,8 +180,7 @@ class HgDriver implements VcsDriverInterface
return false; return false;
} }
exec(sprintf('hg identify %s', escapeshellarg($url)), $output); exec(sprintf('hg identify %s', escapeshellarg($url)), $ignored, $exit);
return $exit === 0;
return (boolean)$output;
} }
} }

View File

@ -178,7 +178,7 @@ class SvnDriver implements VcsDriverInterface
return false; return false;
} }
exec(sprintf('svn info --non-interactive %s', escapeshellarg($url)), $output); exec(sprintf('svn info --non-interactive %s 2>/dev/null', escapeshellarg($url)), $ignored, $exit);
return preg_match('{^Repository UUID:}m', implode("\n", $output)) >= 1; return $exit === 0;
} }
} }