From d81740ab7ddffd9580439bad369b19b8d30e289a Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Mon, 11 Mar 2013 10:04:45 +0100 Subject: [PATCH] Fix authorization/authentication merge, fixes #1684 --- src/Composer/Downloader/GitDownloader.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Composer/Downloader/GitDownloader.php b/src/Composer/Downloader/GitDownloader.php index 6d5e3512f..90f86e945 100644 --- a/src/Composer/Downloader/GitDownloader.php +++ b/src/Composer/Downloader/GitDownloader.php @@ -55,7 +55,7 @@ class GitDownloader extends VcsDownloader // capture username/password from URL if there is one $this->process->execute(sprintf('cd %s && git remote -v', escapeshellarg($path)), $output); if (preg_match('{^(?:composer|origin)\s+https?://(.+):(.+)@([^/]+)}im', $output, $match)) { - $this->io->setAuthorization($match[3], urldecode($match[1]), urldecode($match[2])); + $this->io->setAuthentication($match[3], urldecode($match[1]), urldecode($match[2])); } // added in git 1.7.1, prevents prompting the user @@ -324,8 +324,8 @@ class GitDownloader extends VcsDownloader preg_match('{(https?://)([^/]+)(.*)$}i', $url, $match) && strpos($this->process->getErrorOutput(), 'fatal: Authentication failed') !== false ) { - if ($this->io->hasAuthorization($match[2])) { - $auth = $this->io->getAuthorization($match[2]); + if ($this->io->hasAuthentication($match[2])) { + $auth = $this->io->getAuthentication($match[2]); } else { $this->io->write($url.' requires Authentication'); $auth = array( @@ -338,7 +338,7 @@ class GitDownloader extends VcsDownloader $command = call_user_func($commandCallable, $url); if (0 === $this->process->execute($command, $handler)) { - $this->io->setAuthorization($match[2], $auth['username'], $auth['password']); + $this->io->setAuthentication($match[2], $auth['username'], $auth['password']); return; }