From f42ba46175346e41d8648bd0fb84b757574bc809 Mon Sep 17 00:00:00 2001 From: Alexander Loutsenko Date: Mon, 14 Dec 2015 15:23:15 +0300 Subject: [PATCH] #4331 use --no-auth-cache for svn downloader when such option was set --- src/Composer/Downloader/SvnDownloader.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Composer/Downloader/SvnDownloader.php b/src/Composer/Downloader/SvnDownloader.php index addf95d37..9e75bd081 100644 --- a/src/Composer/Downloader/SvnDownloader.php +++ b/src/Composer/Downloader/SvnDownloader.php @@ -21,6 +21,8 @@ use Composer\Util\Svn as SvnUtil; */ class SvnDownloader extends VcsDownloader { + protected $cacheCredentials = true; + /** * {@inheritDoc} */ @@ -29,6 +31,11 @@ class SvnDownloader extends VcsDownloader SvnUtil::cleanEnv(); $ref = $package->getSourceReference(); + $repoConfig = $package->getRepository()->getRepoConfig(); + if (array_key_exists('svn-cache-credentials', $repoConfig)) { + $this->cacheCredentials = (bool) $repoConfig['svn-cache-credentials']; + } + $this->io->writeError(" Checking out ".$package->getSourceReference()); $this->execute($url, "svn co", sprintf("%s/%s", $url, $ref), null, $path); } @@ -85,6 +92,7 @@ class SvnDownloader extends VcsDownloader protected function execute($baseUrl, $command, $url, $cwd = null, $path = null) { $util = new SvnUtil($baseUrl, $this->io, $this->config); + $util->setCacheCredentials($this->cacheCredentials); try { return $util->execute($command, $url, $cwd, $path, $this->io->isVerbose()); } catch (\RuntimeException $e) {