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

Breadcrumb

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

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\Repository

Code

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