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\RepositoryCode
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);
}