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

Breadcrumb

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

function BaseIO::checkAndSetAuthentication

Check for overwrite and set the authentication information for the repository.

Parameters

string $repositoryName The unique name of repository:

string $username The username:

string $password The password:

Return value

void

1 call to BaseIO::checkAndSetAuthentication()
BaseIO::loadConfiguration in vendor/composer/composer/src/Composer/IO/BaseIO.php
@inheritDoc

File

vendor/composer/composer/src/Composer/IO/BaseIO.php, line 95

Class

BaseIO

Namespace

Composer\IO

Code

protected function checkAndSetAuthentication(string $repositoryName, string $username, ?string $password = null) {
    if ($this->hasAuthentication($repositoryName)) {
        $auth = $this->getAuthentication($repositoryName);
        if ($auth['username'] === $username && $auth['password'] === $password) {
            return;
        }
        $this->writeError(sprintf("<warning>Warning: You should avoid overwriting already defined auth settings for %s.</warning>", $repositoryName));
    }
    $this->setAuthentication($repositoryName, $username, $password);
}

API Navigation

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