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

Breadcrumb

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

function GitLabDriver::attemptCloneFallback

@phpstan-impure

Return value

true

Throws

\RuntimeException

1 call to GitLabDriver::attemptCloneFallback()
GitLabDriver::getContents in vendor/composer/composer/src/Composer/Repository/Vcs/GitLabDriver.php
@inheritDoc

File

vendor/composer/composer/src/Composer/Repository/Vcs/GitLabDriver.php, line 403

Class

GitLabDriver
Driver for GitLab API, use the Git driver for local checkouts.

Namespace

Composer\Repository\Vcs

Code

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