Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. FossilDriver.php

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/&gt;

Namespace

Composer\Repository\Vcs

Code

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;
}
RSS feed
Powered by Drupal