function FossilDriver::supports
@inheritDoc
Overrides VcsDriverInterface::supports
File
-
vendor/
composer/ composer/ src/ Composer/ Repository/ Vcs/ FossilDriver.php, line 222
Class
- FossilDriver
- @author BohwaZ <http://bohwaz.net/>
Namespace
Composer\Repository\VcsCode
public static function supports(IOInterface $io, Config $config, string $url, bool $deep = false) : bool {
if (Preg::isMatch('#(^(?:https?|ssh)://(?:[^@]@)?(?:chiselapp\\.com|fossil\\.))#i', $url)) {
return true;
}
if (Preg::isMatch('!/fossil/|\\.fossil!', $url)) {
return true;
}
// local filesystem
if (Filesystem::isLocalPath($url)) {
$url = Filesystem::getPlatformPath($url);
if (!is_dir($url)) {
return false;
}
$process = new ProcessExecutor($io);
// check whether there is a fossil repo in that path
if ($process->execute([
'fossil',
'info',
], $output, $url) === 0) {
return true;
}
}
return false;
}