Explorar o código

Merge remote-tracking branch 'chorry/4331-svn-creds'

Jordi Boggiano %!s(int64=9) %!d(string=hai) anos
pai
achega
f874842535
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  1. 8 0
      src/Composer/Downloader/SvnDownloader.php

+ 8 - 0
src/Composer/Downloader/SvnDownloader.php

@@ -21,6 +21,8 @@ use Composer\Util\Svn as SvnUtil;
  */
  */
 class SvnDownloader extends VcsDownloader
 class SvnDownloader extends VcsDownloader
 {
 {
+    protected $cacheCredentials = true;
+
     /**
     /**
      * {@inheritDoc}
      * {@inheritDoc}
      */
      */
@@ -29,6 +31,11 @@ class SvnDownloader extends VcsDownloader
         SvnUtil::cleanEnv();
         SvnUtil::cleanEnv();
         $ref = $package->getSourceReference();
         $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->io->writeError("    Checking out ".$package->getSourceReference());
         $this->execute($url, "svn co", sprintf("%s/%s", $url, $ref), null, $path);
         $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)
     protected function execute($baseUrl, $command, $url, $cwd = null, $path = null)
     {
     {
         $util = new SvnUtil($baseUrl, $this->io, $this->config);
         $util = new SvnUtil($baseUrl, $this->io, $this->config);
+        $util->setCacheCredentials($this->cacheCredentials);
         try {
         try {
             return $util->execute($command, $url, $cwd, $path, $this->io->isVerbose());
             return $util->execute($command, $url, $cwd, $path, $this->io->isVerbose());
         } catch (\RuntimeException $e) {
         } catch (\RuntimeException $e) {