class SvnDriver extends VcsDriver (View source)

Properties

protected string $url from VcsDriver
protected string $originUrl from VcsDriver
protected array $repoConfig from VcsDriver
protected IOInterface $io from VcsDriver
protected Config $config from VcsDriver
protected ProcessExecutor $process from VcsDriver
protected RemoteFilesystem $remoteFilesystem from VcsDriver
protected $infoCache
protected Cache $cache
protected $baseUrl
protected $tags
protected $branches
protected $rootIdentifier
protected $trunkPath
protected $branchesPath
protected $tagsPath
protected $packagePath
protected $cacheCredentials

Methods

__construct(array $repoConfig, IOInterface $io, Config $config, ProcessExecutor $process = null, RemoteFilesystem $remoteFilesystem = null)

Constructor.

from VcsDriver
bool
shouldCache(string $identifier)

Returns whether or not the given $identifier should be cached or not.

array
getComposerInformation(string $identifier)

Return the composer.json file information

getBaseComposerInformation($identifier)

No description

from VcsDriver
bool
hasComposerFile(string $identifier)

Return true if the repository has a composer file for a given identifier, false otherwise.

from VcsDriver
string
getScheme()

Get the https or http protocol depending on SSL support.

from VcsDriver
mixed
getContents(string $url)

Get the remote content.

from VcsDriver
cleanup()

Performs any cleanup necessary as the driver is not longer needed

from VcsDriver
initialize()

Initializes the driver (git clone, svn checkout, fetch info etc)

string
getRootIdentifier()

Return the root identifier (trunk, master, default/tip .

string
getUrl()

Return the URL of the repository

array
getSource(string $identifier)

No description

array
getDist(string $identifier)

No description

string
getFileContent(string $file, string $identifier)

No description

getChangeDate(string $identifier)

Get the changedate for $identifier.

array
getTags()

Return list of tags in the repository

array
getBranches()

Return list of branches in the repository

static bool
supports(IOInterface $io, Config $config, string $url, bool $deep = false)

Checks if this driver can handle a given url

static string
normalizeUrl(string $url)

An absolute path (leading '/') is converted to a file:// url.

string
execute(string $command, string $url)

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

string
buildIdentifier(string $baseDir, int $revision)

Build the identifier respecting "package-path" config option

Details

final __construct(array $repoConfig, IOInterface $io, Config $config, ProcessExecutor $process = null, RemoteFilesystem $remoteFilesystem = null)

Constructor.

Parameters

array $repoConfig The repository configuration
IOInterface $io The IO instance
Config $config The composer configuration
ProcessExecutor $process Process instance, injectable for mocking
RemoteFilesystem $remoteFilesystem Remote Filesystem, injectable for mocking

protected bool shouldCache(string $identifier)

Returns whether or not the given $identifier should be cached or not.

Parameters

string $identifier

Return Value

bool

array getComposerInformation(string $identifier)

Return the composer.json file information

Parameters

string $identifier Any identifier to a specific branch/tag/commit

Return Value

array containing all infos from the composer.json file

protected getBaseComposerInformation($identifier)

Parameters

$identifier

bool hasComposerFile(string $identifier)

Return true if the repository has a composer file for a given identifier, false otherwise.

Parameters

string $identifier Any identifier to a specific branch/tag/commit

Return Value

bool Whether the repository has a composer file for a given identifier.

protected string getScheme()

Get the https or http protocol depending on SSL support.

Call this only if you know that the server supports both.

Return Value

string The correct type of protocol

protected mixed getContents(string $url)

Get the remote content.

Parameters

string $url The URL of content

Return Value

mixed The result

cleanup()

Performs any cleanup necessary as the driver is not longer needed

initialize()

Initializes the driver (git clone, svn checkout, fetch info etc)

string getRootIdentifier()

Return the root identifier (trunk, master, default/tip .

.)

Return Value

string Identifier

string getUrl()

Return the URL of the repository

Return Value

string

array getSource(string $identifier)

Parameters

string $identifier Any identifier to a specific branch/tag/commit

Return Value

array With type, url and reference keys.

array getDist(string $identifier)

Parameters

string $identifier Any identifier to a specific branch/tag/commit

Return Value

array With type, url reference and shasum keys.

string getFileContent(string $file, string $identifier)

Parameters

string $file
string $identifier

Return Value

string

DateTime getChangeDate(string $identifier)

Get the changedate for $identifier.

Parameters

string $identifier

Return Value

DateTime

array getTags()

Return list of tags in the repository

Return Value

array Tag names as keys, identifiers as values

array getBranches()

Return list of branches in the repository

Return Value

array Branch names as keys, identifiers as values

static bool supports(IOInterface $io, Config $config, string $url, bool $deep = false)

Checks if this driver can handle a given url

Parameters

IOInterface $io IO instance
Config $config current $config
string $url URL to validate/check
bool $deep unless true, only shallow checks (url matching typically) should be done

Return Value

bool

static protected string normalizeUrl(string $url)

An absolute path (leading '/') is converted to a file:// url.

Parameters

string $url

Return Value

string

protected string execute(string $command, string $url)

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

Parameters

string $command The svn command to run.
string $url The SVN URL.

Return Value

string

Exceptions

RuntimeException

protected string buildIdentifier(string $baseDir, int $revision)

Build the identifier respecting "package-path" config option

Parameters

string $baseDir The path to trunk/branch/tag
int $revision The revision mark to add to identifier

Return Value

string