PHP Class Jyxo\Svn\Client

Does not use the php_svn extension, but executes SVN binaries directly.
Author: Matěj Humpál
Author: Ondřej Nešpor
Datei anzeigen Open project: jyxo/php

Protected Properties

Property Type Description
$additional array Additional SVN parameters.
$password string SVN user password.
$svnBinary string Path to the SVN binary.
$user string SVN username.

Public Methods

Method Description
__construct ( string $user = '', string $password = '', array $additional = [], string $svnBinary = '' ) Constructor.
add ( array $path ) : Result Runs SVN add on the given path.
addAdditionalParam ( string $param, string $value = '' ) : Client Adds an additional parameter.
checkout ( string $url, string $path, mixed $params = null, string $user = '', string $password = '' ) : Result SVN checkout.
ci ( string $path, string $message, mixed $params = null, string $user = '', string $password = '' ) : Result SVN commit.
co ( string $url, string $path, mixed $params = null, string $user = '', string $password = '' ) : Result SVN checkout.
commit ( string $path, string $message, mixed $params = null, string $user = '', string $password = '' ) : Result SVN commit.
delete ( array $path ) : Result Runs SVN delete on the given path.
setAdditionalParams ( array $params ) : Client Sets additional parameters.
setPassword ( string $password ) : Client Sets SVN user password.
setSvnBinary ( string $path ) : Client Sets SVN binary path.
setUser ( string $user ) : Client Sets SVN username.
status ( array $path ) : Result Retrieves SVN status information of the given path.
up ( string $path, mixed $params = null, string $user = '', string $password = '' ) : Result SVN Update.
update ( string $path, mixed $params = null, string $user = '', string $password = '' ) : Result SVN Update.

Protected Methods

Method Description
callSvn ( string $action, string $user, string $password, array $params ) : Result Executes SVN binary with given parameters.
getAdditionalParams ( array $params = [], boolean $pathsOnly = false ) : string Returns additional parameters with the given value for use as SVN binary parameters.
getPasswordString ( mixed $password = '' ) : string Returns SVN user password with the given value for use as SVN binary parameter.
getUserString ( mixed $user = '' ) : string Returns SVN username with the given value for use as SVN binary parameter.

Method Details

__construct() public method

Constructor.
public __construct ( string $user = '', string $password = '', array $additional = [], string $svnBinary = '' )
$user string SVN username
$password string SVN user password
$additional array Additional parameters
$svnBinary string SVN binary path

add() public method

Runs SVN add on the given path.
public add ( array $path ) : Result
$path array Path to be added to SVN
return Result

addAdditionalParam() public method

Adds an additional parameter.
public addAdditionalParam ( string $param, string $value = '' ) : Client
$param string Parameter name
$value string Parameter value
return Client

callSvn() protected method

Executes SVN binary with given parameters.
protected callSvn ( string $action, string $user, string $password, array $params ) : Result
$action string Action
$user string Username
$password string User password
$params array Additional parameters
return Result

checkout() public method

SVN checkout.
public checkout ( string $url, string $path, mixed $params = null, string $user = '', string $password = '' ) : Result
$url string Repository URL
$path string Local working copy path
$params mixed Additional parameters
$user string SVN username
$password string SVN user password
return Result

ci() public method

SVN commit.
public ci ( string $path, string $message, mixed $params = null, string $user = '', string $password = '' ) : Result
$path string Local working copy path
$message string Commit message
$params mixed Additional parameters
$user string SVN username
$password string SVN user password
return Result

co() public method

SVN checkout.
public co ( string $url, string $path, mixed $params = null, string $user = '', string $password = '' ) : Result
$url string Repository URL
$path string Local working copy path
$params mixed Additional parameters
$user string SVN username
$password string SVN user password
return Result

commit() public method

SVN commit.
public commit ( string $path, string $message, mixed $params = null, string $user = '', string $password = '' ) : Result
$path string Local working copy path
$message string Commit message
$params mixed Additional parameters
$user string SVN username
$password string SVN user password
return Result

delete() public method

Runs SVN delete on the given path.
public delete ( array $path ) : Result
$path array Path to be deleted from SVN
return Result

getAdditionalParams() protected method

Parameters given in the argument have precedence over values stored in object's attribute. If parameters are given as arrays, they get merged. Returns empty string if no parameters are set in any way.
protected getAdditionalParams ( array $params = [], boolean $pathsOnly = false ) : string
$params array Parameters
$pathsOnly boolean Use only path-parameters (not beginning with a dash "-")
return string

getPasswordString() protected method

Password given in the argument has precedence over the value stored in object's attribute. Returns empty string if no password is set in any way.
protected getPasswordString ( mixed $password = '' ) : string
$password mixed Password
return string

getUserString() protected method

Username given in the argument has precedence over the value stored in object's attribute. Returns empty string if no username is set in any way.
protected getUserString ( mixed $user = '' ) : string
$user mixed Username
return string

setAdditionalParams() public method

Sets additional parameters.
public setAdditionalParams ( array $params ) : Client
$params array Array of parameters
return Client

setPassword() public method

Sets SVN user password.
public setPassword ( string $password ) : Client
$password string Password
return Client

setSvnBinary() public method

Sets SVN binary path.
public setSvnBinary ( string $path ) : Client
$path string Path to the SVN binary
return Client

setUser() public method

Sets SVN username.
public setUser ( string $user ) : Client
$user string Username
return Client

status() public method

Retrieves SVN status information of the given path.
public status ( array $path ) : Result
$path array Checked path
return Result

up() public method

SVN Update.
public up ( string $path, mixed $params = null, string $user = '', string $password = '' ) : Result
$path string Local working copy path
$params mixed Additional parameters
$user string SVN username
$password string SVN user password
return Result

update() public method

SVN Update.
public update ( string $path, mixed $params = null, string $user = '', string $password = '' ) : Result
$path string Local working copy path
$params mixed Additional parameters
$user string SVN username
$password string SVN user password
return Result

Property Details

$additional protected_oe property

Additional SVN parameters.
protected array $additional
return array

$password protected_oe property

SVN user password.
protected string $password
return string

$svnBinary protected_oe property

Path to the SVN binary.
protected string $svnBinary
return string

$user protected_oe property

SVN username.
protected string $user
return string