PHP SVN CLIENT

This class is a SVN client. It can perform read operations to a SVN server (over Web-DAV). It can get directory files, file contents, logs. All the operaration could be done for a specific version or for the last version.

author Cesar D. Rodas <cesar@sixdegrees.com.br> @license BSD License

 Methods

__construct()

__construct($url, $user, $pass) 

Parameters

$url

$user

$pass

checkOut

checkOut($folder, $outPath) 

Parameters

$folder

$outPath

getDirectoryFiles

getDirectoryFiles(string $folder, $version) 

This method returns all the files in $folder in the version $version of the repository.

Parameters

$folder

string

Folder to get files @param integer $version Repository version, -1 means actual @return array List of files.

$version

getDirectoryTree

getDirectoryTree(string $folder, $version, $recursive) 

This method returns the complete tree of files and directories in $folder from the version $version of the repository. Can also be used to get the info for a single file or directory

Parameters

$folder

string

Folder to get tree @param integer $version Repository version, -1 means actual @param boolean $recursive Whether to get the tree recursively, or just the specified directory/file. @return array List of files and directories.

$version

$recursive

Returns file contents

getFile($file, integer $version) 

@param string $file File pathname

Parameters

$file

$version

integer

File Version @return string File content and information, false on error, or if a directory is requested

Get changes logs of a file.

getFileLogs(\@param $file, $vini, $vend) 

Get repository change of a file between version $vini and $vend.

Parameters

$file

\@param

integer $vini Initial Version @param integer $vend End Version @return Array Respository Logs

$vini

$vend

Get changes logs of a file.

getRepositoryLogs(integer $vini, $vend) 

Get repository change logs between version $vini and $vend.

Parameters

$vini

integer

Initial Version @param integer $vend End Version @return Array Respository Logs

$vend

Get the repository version

getVersion() 

@return integer Repository version

access public

phpsvnclient()

phpsvnclient($url, $user, $pass) 

Parameters

$url

$user

$pass

rawDirectoryDump

rawDirectoryDump(string $folder, $version) 

This method dumps SVN data for $folder in the version $version of the repository.

Parameters

$folder

string

Folder to get data @param integer $version Repository version, -1 means actual @return array SVN data dump.

$version

Add Authentication settings

setAuth($user, string $pass) 

@param string $user Username

Parameters

$user

$pass

string

Password

Set URL

setRepository(string $url) 

Set the project repository URL.

Parameters

$url

string

URL of the project. @access public

Old method; there's a typo in the name.

setRespository($url) 

This is now a wrapper for setRepository

Parameters

$url

Open a connection, send request, read header and body.

Request(Array $args, $headers, $body) 

@param Array $args Connetion's argument

Parameters

$args

Array

&$headers Array with the header response. @param string &$body Body response. @return boolean True is query success @access private

$headers

$body

Clean URL

cleanURL(string $url) 

Delete "//" on URL requests.

Parameters

$url

string

URL @return string New cleaned URL. @access private

Prepare HTTP CLIENT object

initQuery($arguments, string $method, $url) 

@param array &$arguments Byreferences variable.

Parameters

$arguments

$method

string

Method for the request (GET,POST,PROPFIND, REPORT,ETC). @param string $url URL for the action. @access private

$url

Callback for array_walk_recursive in public function getDirectoryFiles

storeDirectoryFiles($item, $key) 

@access private

Parameters

$item

$key

 Properties

 

$_cache 

@var string

access private
 

$_http 

@var object

access private
 

$_repVersion : \interger

@access private

 

$_url 

@var string

access private
 

$lastDirectoryFiles 
 

$pass : string

@access private

 

$storeDirectoryFiles 
 

$user : string

@access private