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

Breadcrumb

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

function VcsRepository::__construct

Parameters

array{url: string, type?: string}&array<string, mixed> $repoConfig:

array<string, class-string<VcsDriverInterface>>|null $drivers:

Overrides ArrayRepository::__construct

File

vendor/composer/composer/src/Composer/Repository/VcsRepository.php, line 78

Class

VcsRepository
@author Jordi Boggiano <j.boggiano@seld.be>

Namespace

Composer\Repository

Code

public function __construct(array $repoConfig, IOInterface $io, Config $config, HttpDownloader $httpDownloader, ?EventDispatcher $dispatcher = null, ?ProcessExecutor $process = null, ?array $drivers = null, ?VersionCacheInterface $versionCache = null) {
    parent::__construct();
    $this->drivers = $drivers ?: [
        'github' => 'Composer\\Repository\\Vcs\\GitHubDriver',
        'gitlab' => 'Composer\\Repository\\Vcs\\GitLabDriver',
        'bitbucket' => 'Composer\\Repository\\Vcs\\GitBitbucketDriver',
        'git-bitbucket' => 'Composer\\Repository\\Vcs\\GitBitbucketDriver',
        'git' => 'Composer\\Repository\\Vcs\\GitDriver',
        'hg' => 'Composer\\Repository\\Vcs\\HgDriver',
        'perforce' => 'Composer\\Repository\\Vcs\\PerforceDriver',
        'fossil' => 'Composer\\Repository\\Vcs\\FossilDriver',
        // svn must be last because identifying a subversion server for sure is practically impossible
'svn' => 'Composer\\Repository\\Vcs\\SvnDriver',
    ];
    $this->url = $repoConfig['url'] = Platform::expandPath($repoConfig['url']);
    $this->io = $io;
    $this->type = $repoConfig['type'] ?? 'vcs';
    $this->isVerbose = $io->isVerbose();
    $this->isVeryVerbose = $io->isVeryVerbose();
    $this->config = $config;
    $this->repoConfig = $repoConfig;
    $this->versionCache = $versionCache;
    $this->httpDownloader = $httpDownloader;
    $this->processExecutor = $process ?? new ProcessExecutor($io);
}
RSS feed
Powered by Drupal