Explorar o código

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

Jordi Boggiano %!s(int64=9) %!d(string=hai) anos
pai
achega
6d1e8ebf90
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  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>",