class Svn (View source)

Constants

MAX_QTY_AUTH_TRIES

Properties

protected array $credentials
protected bool $hasAuth
protected IOInterface $io
protected string $url
protected bool $cacheCredentials
protected ProcessExecutor $process
protected int $qtyAuthTries
protected Config $config

Methods

__construct(string $url, IOInterface $io, Config $config, ProcessExecutor $process = null)

No description

static 
cleanEnv()

No description

string
execute(string $command, string $url, string $cwd = null, string $path = null, bool $verbose = false)

Execute an SVN remote command and try to fix up the process with credentials if necessary.

string
executeLocal(string $command, string $path, string $cwd = null, bool $verbose = false)

Execute an SVN local command and try to fix up the process with credentials if necessary.

setCacheCredentials(bool $cacheCredentials)

No description

Svn
doAuthDance()

Repositories requests credentials, let's put them in.

string
getCommand(string $cmd, string $url, string $path = null)

A method to create the svn commands run.

string
getCredentialString()

Return the credential string for the svn command.

string
getPassword()

Get the password for the svn command. Can be empty.

string
getUsername()

Get the username for the svn command.

bool
hasAuth()

Detect Svn Auth.

string
getAuthCache()

Return the no-auth-cache switch.

string|null
binaryVersion()

Returns the version of the svn binary contained in PATH

Details

__construct(string $url, IOInterface $io, Config $config, ProcessExecutor $process = null)

Parameters

string $url
IOInterface $io
Config $config
ProcessExecutor $process

static cleanEnv()

string execute(string $command, string $url, string $cwd = null, string $path = null, bool $verbose = false)

Execute an SVN remote command and try to fix up the process with credentials if necessary.

Parameters

string $command SVN command to run
string $url SVN url
string $cwd Working directory
string $path Target for a checkout
bool $verbose Output all output to the user

Return Value

string

Exceptions

RuntimeException

string executeLocal(string $command, string $path, string $cwd = null, bool $verbose = false)

Execute an SVN local command and try to fix up the process with credentials if necessary.

Parameters

string $command SVN command to run
string $path Path argument passed thru to the command
string $cwd Working directory
bool $verbose Output all output to the user

Return Value

string

Exceptions

RuntimeException

setCacheCredentials(bool $cacheCredentials)

Parameters

bool $cacheCredentials

protected Svn doAuthDance()

Repositories requests credentials, let's put them in.

Return Value

Svn

Exceptions

RuntimeException

protected string getCommand(string $cmd, string $url, string $path = null)

A method to create the svn commands run.

Parameters

string $cmd Usually 'svn ls' or something like that.
string $url Repo URL.
string $path Target for a checkout

Return Value

string

protected string getCredentialString()

Return the credential string for the svn command.

Adds --no-auth-cache when credentials are present.

Return Value

string

protected string getPassword()

Get the password for the svn command. Can be empty.

Return Value

string

Exceptions

LogicException

protected string getUsername()

Get the username for the svn command.

Return Value

string

Exceptions

LogicException

protected bool hasAuth()

Detect Svn Auth.

Return Value

bool

protected string getAuthCache()

Return the no-auth-cache switch.

Return Value

string

string|null binaryVersion()

Returns the version of the svn binary contained in PATH

Return Value

string|null