function VcsRepository::getDriver
2 calls to VcsRepository::getDriver()
- VcsRepository::getRepoName in vendor/
composer/ composer/ src/ Composer/ Repository/ VcsRepository.php - Returns a name representing this repository to the user
- VcsRepository::initialize in vendor/
composer/ composer/ src/ Composer/ Repository/ VcsRepository.php - Initializes the packages array. Mostly meant as an extension point.
File
-
vendor/
composer/ composer/ src/ Composer/ Repository/ VcsRepository.php, line 127
Class
- VcsRepository
- @author Jordi Boggiano <j.boggiano@seld.be>
Namespace
Composer\RepositoryCode
public function getDriver() : ?VcsDriverInterface {
if ($this->driver) {
return $this->driver;
}
if (isset($this->drivers[$this->type])) {
$class = $this->drivers[$this->type];
$this->driver = new $class($this->repoConfig, $this->io, $this->config, $this->httpDownloader, $this->processExecutor);
$this->driver
->initialize();
return $this->driver;
}
foreach ($this->drivers as $driver) {
if ($driver::supports($this->io, $this->config, $this->url)) {
$this->driver = new $driver($this->repoConfig, $this->io, $this->config, $this->httpDownloader, $this->processExecutor);
$this->driver
->initialize();
return $this->driver;
}
}
foreach ($this->drivers as $driver) {
if ($driver::supports($this->io, $this->config, $this->url, true)) {
$this->driver = new $driver($this->repoConfig, $this->io, $this->config, $this->httpDownloader, $this->processExecutor);
$this->driver
->initialize();
return $this->driver;
}
}
return null;
}