Composer API
Class

Composer\Repository\Vcs\GitLabDriver

class GitLabDriver extends VcsDriver

Driver for GitLab API, use the Git driver for local checkouts.

Constants

URL_REGEX

Methods

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

Constructor.

from VcsDriver
array getComposerInformation(string $identifier)

Return the composer.json file information

from VcsDriver
bool hasComposerFile(string $identifier)

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

from VcsDriver
cleanup()

Performs any cleanup necessary as the driver is not longer needed

from VcsDriver
initialize()

Extracts information from the repository url.

setRemoteFilesystem(RemoteFilesystem $remoteFilesystem)

Updates the RemoteFilesystem instance.

string getFileContent(string $file, string $identifier)

Return the content of $file or null if the file does not exist.

DateTime getChangeDate(string $identifier)

Get the changedate for $identifier.

getRepositoryUrl()

{@inheritDoc}

string getUrl()

Return the URL of the repository

array getDist(string $identifier)

array getSource(string $identifier)

string getRootIdentifier()

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

array getBranches()

Return list of branches in the repository

array getTags()

Return list of tags in the repository

string getApiUrl()

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

Uses the config gitlab-domains to see if the driver supports the url for the repository given.

Details

in VcsDriver at line 60
final public __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

in VcsDriver at line 89
public 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

in VcsDriver at line 128
public 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.

in VcsDriver at line 171
public cleanup()

Performs any cleanup necessary as the driver is not longer needed

at line 78
public initialize()

Extracts information from the repository url.

SSH urls use https by default. Set "secure-http": false on the repository config to use http instead.

{@inheritDoc}

at line 107
public setRemoteFilesystem(RemoteFilesystem $remoteFilesystem)

Updates the RemoteFilesystem instance.

Mainly useful for tests.

Parameters

RemoteFilesystem $remoteFilesystem

at line 115
public string getFileContent(string $file, string $identifier)

Return the content of $file or null if the file does not exist.

Parameters

string $file
string $identifier

Return Value

string

at line 147
public DateTime getChangeDate(string $identifier)

Get the changedate for $identifier.

Parameters

string $identifier

Return Value

DateTime

at line 163
public getRepositoryUrl()

{@inheritDoc}

at line 171
public string getUrl()

Return the URL of the repository

Return Value

string

at line 183
public 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.

at line 193
public array getSource(string $identifier)

Parameters

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

Return Value

array With type, url and reference keys.

at line 205
public string getRootIdentifier()

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

Return Value

string Identifier

at line 217
public array getBranches()

Return list of branches in the repository

Return Value

array Branch names as keys, identifiers as values

at line 233
public array getTags()

Return list of tags in the repository

Return Value

array Tag names as keys, identifiers as values

at line 249
public string getApiUrl()

Return Value

string Base URL for GitLab API v3

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

Uses the config gitlab-domains to see if the driver supports the url for the repository given.

{@inheritDoc}

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