function GitHubDriver::supports
@inheritDoc
Overrides VcsDriverInterface::supports
File
-
vendor/
composer/ composer/ src/ Composer/ Repository/ Vcs/ GitHubDriver.php, line 398
Class
- GitHubDriver
- @author Jordi Boggiano <j.boggiano@seld.be>
Namespace
Composer\Repository\VcsCode
public static function supports(IOInterface $io, Config $config, string $url, bool $deep = false) : bool {
if (!Preg::isMatch('#^((?:https?|git)://([^/]+)/|git@([^:]+):/?)([^/]+)/([^/]+?)(?:\\.git|/)?$#', $url, $matches)) {
return false;
}
$originUrl = $matches[2] ?? (string) $matches[3];
if (!in_array(strtolower(Preg::replace('{^www\\.}i', '', $originUrl)), $config->get('github-domains'))) {
return false;
}
if (!extension_loaded('openssl')) {
$io->writeError('Skipping GitHub driver for ' . $url . ' because the OpenSSL PHP extension is missing.', true, IOInterface::VERBOSE);
return false;
}
return true;
}