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
Namespace
Composer\IOCode
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);
}