瀏覽代碼

* added a method to return the credential string for the svn command

till 13 年之前
父節點
當前提交
275d1c9969
共有 1 個文件被更改,包括 16 次插入0 次删除
  1. 16 0
      src/Composer/Repository/Vcs/SvnDriver.php

+ 16 - 0
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}
      */