Browse Source

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

Jordi Boggiano 9 years ago
parent
commit
6d1e8ebf90
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/Composer/IO/BaseIO.php

+ 5 - 0
src/Composer/IO/BaseIO.php

@@ -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>",