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

Breadcrumb

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

function Git::getAuthenticationFailure

Return value

array<int, string>|null

1 call to Git::getAuthenticationFailure()
Git::runCommand in vendor/composer/composer/src/Composer/Util/Git.php

File

vendor/composer/composer/src/Composer/Util/Git.php, line 477

Class

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

Namespace

Composer\Util

Code

private function getAuthenticationFailure(string $url) : ?array {
    if (!Preg::isMatchStrictGroups('{^(https?://)([^/]+)(.*)$}i', $url, $match)) {
        return null;
    }
    $authFailures = [
        'fatal: Authentication failed',
        'remote error: Invalid username or password.',
        'error: 401 Unauthorized',
        'fatal: unable to access',
        'fatal: could not read Username',
    ];
    $errorOutput = $this->process
        ->getErrorOutput();
    foreach ($authFailures as $authFailure) {
        if (strpos($errorOutput, $authFailure) !== false) {
            return $match;
        }
    }
    return null;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal