From 275d1c996994376738f37896a0fa063b34207a3d Mon Sep 17 00:00:00 2001 From: till Date: Fri, 2 Mar 2012 19:46:11 +0100 Subject: [PATCH] * added a method to return the credential string for the svn command --- src/Composer/Repository/Vcs/SvnDriver.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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} */