* fix up CS suggestions from stof/seldaek
parent
68fa23f5c7
commit
c6653f0711
|
@ -18,16 +18,17 @@ use Composer\Util\Svn as SvnUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Ben Bieker <mail@ben-bieker.de>
|
* @author Ben Bieker <mail@ben-bieker.de>
|
||||||
|
* @author Till Klampaeckel <till@php.net>
|
||||||
*/
|
*/
|
||||||
class SvnDownloader extends VcsDownloader
|
class SvnDownloader extends VcsDownloader
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var bool $useAuth
|
* @var bool
|
||||||
*/
|
*/
|
||||||
protected $useAuth = false;
|
protected $useAuth = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \Composer\Util\Svn $util
|
* @var \Composer\Util\Svn
|
||||||
*/
|
*/
|
||||||
protected $util;
|
protected $util;
|
||||||
|
|
||||||
|
@ -99,7 +100,7 @@ class SvnDownloader extends VcsDownloader
|
||||||
}
|
}
|
||||||
|
|
||||||
// the error is not auth-related
|
// the error is not auth-related
|
||||||
if (strpos($output, 'authorization failed:') === false) {
|
if (false === strpos($output, 'authorization failed:')) {
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,7 +118,7 @@ class SvnDownloader extends VcsDownloader
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is heavy - recreating Util often.
|
* This is potentially heavy - recreating Util often.
|
||||||
*
|
*
|
||||||
* @param string $url
|
* @param string $url
|
||||||
*
|
*
|
||||||
|
|
|
@ -9,6 +9,7 @@ use Composer\IO\IOInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Jordi Boggiano <j.boggiano@seld.be>
|
* @author Jordi Boggiano <j.boggiano@seld.be>
|
||||||
|
* @author Till Klampaeckel <till@php.net>
|
||||||
*/
|
*/
|
||||||
class SvnDriver extends VcsDriver
|
class SvnDriver extends VcsDriver
|
||||||
{
|
{
|
||||||
|
@ -18,41 +19,38 @@ class SvnDriver extends VcsDriver
|
||||||
protected $infoCache = array();
|
protected $infoCache = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var boolean $useAuth Contains credentials, or not?
|
* Contains credentials, or not?
|
||||||
|
* @var boolean
|
||||||
*/
|
*/
|
||||||
protected $useAuth = false;
|
protected $useAuth = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var boolean $useCache To determine if we should cache the credentials
|
* To determine if we should cache the credentials supplied by the user. By default: no cache.
|
||||||
* supplied by the user. By default: no cache.
|
* @var boolean
|
||||||
* @see self::getSvnAuthCache()
|
|
||||||
*/
|
*/
|
||||||
protected $useCache = false;
|
protected $useCache = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string $svnUsername
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $svnUsername = '';
|
protected $svnUsername = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string $svnPassword
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $svnPassword = '';
|
protected $svnPassword = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Composer\Util\Svn $util
|
* @var \Composer\Util\Svn
|
||||||
*/
|
*/
|
||||||
protected $util;
|
protected $util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* __construct
|
|
||||||
*
|
|
||||||
* @param string $url
|
* @param string $url
|
||||||
* @param IOInterface $io
|
* @param IOInterface $io
|
||||||
* @param ProcessExecutor $process
|
* @param ProcessExecutor $process
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
* @uses self::detectSvnAuth()
|
|
||||||
*/
|
*/
|
||||||
public function __construct($url, IOInterface $io, ProcessExecutor $process = null)
|
public function __construct($url, IOInterface $io, ProcessExecutor $process = null)
|
||||||
{
|
{
|
||||||
|
@ -74,9 +72,6 @@ class SvnDriver extends VcsDriver
|
||||||
* @param string $url The SVN URL.
|
* @param string $url The SVN URL.
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
* @uses Composer\Util\Svn::getCommand()
|
|
||||||
* @uses parent::$process
|
|
||||||
* @see ProcessExecutor::execute()
|
|
||||||
*/
|
*/
|
||||||
public function execute($command, $url)
|
public function execute($command, $url)
|
||||||
{
|
{
|
||||||
|
|
|
@ -19,34 +19,32 @@ use Composer\IO\IOInterface;
|
||||||
class Svn
|
class Svn
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var mixed $credentials
|
* @var mixed
|
||||||
* @see self::hasAuth()
|
|
||||||
*/
|
*/
|
||||||
protected $credentials;
|
protected $credentials;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var boolean $hasAuth
|
* @var bool
|
||||||
*/
|
*/
|
||||||
protected $hasAuth;
|
protected $hasAuth;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \Composer\IO\IOInterface $io
|
* @var \Composer\IO\IOInterface
|
||||||
*/
|
*/
|
||||||
protected $io;
|
protected $io;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string $url
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $url;
|
protected $url;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var bool $useCache Cache credentials.
|
* Cache credentials.
|
||||||
|
* @var bool
|
||||||
*/
|
*/
|
||||||
protected $useCache = false;
|
protected $useCache = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* __construct
|
|
||||||
*
|
|
||||||
* @param string $url
|
* @param string $url
|
||||||
* @param \Composer\IO\IOInterface $io
|
* @param \Composer\IO\IOInterface $io
|
||||||
*
|
*
|
||||||
|
@ -59,15 +57,9 @@ class Svn
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* doAuthDance
|
|
||||||
*
|
|
||||||
* Repositories requests credentials, let's put them in.
|
* Repositories requests credentials, let's put them in.
|
||||||
*
|
*
|
||||||
* @return \Composer\Util\Svn
|
* @return \Composer\Util\Svn
|
||||||
* @uses self::$io
|
|
||||||
* @uses self::$hasAuth
|
|
||||||
* @uses self::$credentials
|
|
||||||
* @uses self::$useCache
|
|
||||||
*/
|
*/
|
||||||
public function doAuthDance()
|
public function doAuthDance()
|
||||||
{
|
{
|
||||||
|
@ -80,7 +72,7 @@ class Svn
|
||||||
$this->credentials->password = $this->io->askAndHideAnswer("Password: ");
|
$this->credentials->password = $this->io->askAndHideAnswer("Password: ");
|
||||||
|
|
||||||
$pleaseCache = $this->io->askConfirmation("Should Subversion cache these credentials? (yes/no) ", false);
|
$pleaseCache = $this->io->askConfirmation("Should Subversion cache these credentials? (yes/no) ", false);
|
||||||
if ($pleaseCache === true) {
|
if ($pleaseCache) {
|
||||||
$this->useCache = true;
|
$this->useCache = true;
|
||||||
}
|
}
|
||||||
return $this;
|
return $this;
|
||||||
|
@ -89,8 +81,6 @@ class Svn
|
||||||
* Return the no-auth-cache switch.
|
* Return the no-auth-cache switch.
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
* @uses selfg::$useCache
|
|
||||||
* @see self::doAuthDance()
|
|
||||||
*/
|
*/
|
||||||
public function getAuthCache()
|
public function getAuthCache()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue