From b2efb95f3323266d7646dca5210b30c098e0d5cb Mon Sep 17 00:00:00 2001 From: Anael Ollier Date: Mon, 27 Apr 2015 15:26:32 +0200 Subject: [PATCH 1/3] Fixed svn update command (fails before attempting to use authentication provided in auth.json) --- src/Composer/Util/Svn.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Composer/Util/Svn.php b/src/Composer/Util/Svn.php index 9ba08bf85..b91592b03 100644 --- a/src/Composer/Util/Svn.php +++ b/src/Composer/Util/Svn.php @@ -120,16 +120,18 @@ class Svn return $output; } + $errorOutput = $this->process->getErrorOutput(); if (empty($output)) { - $output = $this->process->getErrorOutput(); + $output = $errorOutput; } + $fullOutput = "$output\n$errorOutput"; // the error is not auth-related - if (false === stripos($output, 'Could not authenticate to server:') - && false === stripos($output, 'authorization failed') - && false === stripos($output, 'svn: E170001:') - && false === stripos($output, 'svn: E215004:')) { - throw new \RuntimeException($output); + if (false === stripos($fullOutput, 'Could not authenticate to server:') + && false === stripos($fullOutput, 'authorization failed') + && false === stripos($fullOutput, 'svn: E170001:') + && false === stripos($fullOutput, 'svn: E215004:')) { + throw new \RuntimeException($fullOutput); } if (!$this->hasAuth()) { From 2f82ed7035802ae72b4953127b784e4fdb985090 Mon Sep 17 00:00:00 2001 From: Anael Ollier Date: Tue, 28 Apr 2015 11:19:29 +0200 Subject: [PATCH 2/3] Fixed the fix :) --- src/Composer/Util/Svn.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Composer/Util/Svn.php b/src/Composer/Util/Svn.php index b91592b03..fc9a547ba 100644 --- a/src/Composer/Util/Svn.php +++ b/src/Composer/Util/Svn.php @@ -121,10 +121,7 @@ class Svn } $errorOutput = $this->process->getErrorOutput(); - if (empty($output)) { - $output = $errorOutput; - } - $fullOutput = "$output\n$errorOutput"; + $fullOutput = join("\n", array($output, $errorOutput)); // the error is not auth-related if (false === stripos($fullOutput, 'Could not authenticate to server:') @@ -145,7 +142,7 @@ class Svn } throw new \RuntimeException( - 'wrong credentials provided ('.$output.')' + 'wrong credentials provided ('.$fullOutput.')' ); } From 27074083cc0b6c918b047f8dc18186aac0528dff Mon Sep 17 00:00:00 2001 From: Anael Ollier Date: Tue, 28 Apr 2015 13:23:00 +0200 Subject: [PATCH 3/3] Replaced join() by implode() --- src/Composer/Util/Svn.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Util/Svn.php b/src/Composer/Util/Svn.php index fc9a547ba..d5694b3be 100644 --- a/src/Composer/Util/Svn.php +++ b/src/Composer/Util/Svn.php @@ -121,7 +121,7 @@ class Svn } $errorOutput = $this->process->getErrorOutput(); - $fullOutput = join("\n", array($output, $errorOutput)); + $fullOutput = implode("\n", array($output, $errorOutput)); // the error is not auth-related if (false === stripos($fullOutput, 'Could not authenticate to server:')