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

Breadcrumb

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

function GitHubDriver::attemptCloneFallback

@phpstan-impure

Return value

true

Throws

\RuntimeException

2 calls to GitHubDriver::attemptCloneFallback()
GitHubDriver::fetchRootIdentifier in vendor/composer/composer/src/Composer/Repository/Vcs/GitHubDriver.php
Fetch root identifier from GitHub
GitHubDriver::getContents in vendor/composer/composer/src/Composer/Repository/Vcs/GitHubDriver.php
@inheritDoc

File

vendor/composer/composer/src/Composer/Repository/Vcs/GitHubDriver.php, line 577

Class

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

Namespace

Composer\Repository\Vcs

Code

protected function attemptCloneFallback() : bool {
    $this->isPrivate = true;
    try {
        // If this repository may be private (hard to say for sure,
        // GitHub returns 404 for private repositories) and we
        // cannot ask for authentication credentials (because we
        // are not interactive) then we fallback to GitDriver.
        $this->setupGitDriver($this->generateSshUrl());
        return true;
    } catch (\RuntimeException $e) {
        $this->gitDriver = null;
        $this->io
            ->writeError('<error>Failed to clone the ' . $this->generateSshUrl() . ' repository, try running in interactive mode so that you can enter your GitHub credentials</error>');
        throw $e;
    }
}
RSS feed
Powered by Drupal