|
|
@ -20,6 +20,8 @@ use Composer\IO\IOInterface;
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
class Svn
|
|
|
|
class Svn
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
const MAX_QTY_AUTH_TRIES = 5;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @var array
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -50,6 +52,11 @@ class Svn
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
protected $process;
|
|
|
|
protected $process;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @var integer
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
protected $qtyAuthTries = 0;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @param string $url
|
|
|
|
* @param string $url
|
|
|
|
* @param \Composer\IO\IOInterface $io
|
|
|
|
* @param \Composer\IO\IOInterface $io
|
|
|
@ -112,11 +119,8 @@ class Svn
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// TODO keep a count of user auth attempts and ask 5 times before
|
|
|
|
// try to authenticate if maximum quantity of tries not reached
|
|
|
|
// failing hard (currently it fails hard directly if the URL has credentials)
|
|
|
|
if ($this->qtyAuthTries++ < self::MAX_QTY_AUTH_TRIES || !$this->hasAuth()) {
|
|
|
|
|
|
|
|
|
|
|
|
// try to authenticate
|
|
|
|
|
|
|
|
if (!$this->hasAuth()) {
|
|
|
|
|
|
|
|
$this->doAuthDance();
|
|
|
|
$this->doAuthDance();
|
|
|
|
|
|
|
|
|
|
|
|
// restart the process
|
|
|
|
// restart the process
|
|
|
|