1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-10 00:53:06 +00:00

Avoid warnings due to duplicate loading of auth files, fixes #4971

This commit is contained in:
Jordi Boggiano 2016-03-02 14:10:21 +00:00
parent 9d95456bb0
commit 6d1e8ebf90

View file

@ -65,6 +65,11 @@ abstract class BaseIO implements IOInterface
protected function checkAndSetAuthentication($repositoryName, $username, $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>",