diff --git a/src/Composer/Repository/Vcs/SvnDriver.php b/src/Composer/Repository/Vcs/SvnDriver.php index 43ba91206..7274c9ccd 100644 --- a/src/Composer/Repository/Vcs/SvnDriver.php +++ b/src/Composer/Repository/Vcs/SvnDriver.php @@ -171,6 +171,22 @@ class SvnDriver extends VcsDriver implements VcsDriverInterface return $this->branches; } + /** + * Return the credential string for the svn command. + * + * --no-auth-cache when credentials are present + * + * @return string + */ + public function getSvnCredentialString() + { + if ($this->useAuth !== true) { + return ''; + } + $str = ' --no-auth-cache --username "%s" --password "%s"'; + return sprintf($str, $this->svnUsername, $this->svnPassword); + } + /** * {@inheritDoc} */