abstract class VcsDriver implements VcsDriverInterface (View source)

A driver implementation for driver with authentication interaction.

Properties

protected string $url
protected string $originUrl
protected array $repoConfig
protected IOInterface $io
protected Config $config
protected ProcessExecutor $process
protected RemoteFilesystem $remoteFilesystem
protected array $infoCache
protected Cache $cache

Methods

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

Constructor.

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

bool
hasComposerFile(string $identifier)

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

string
getScheme()

Get the https or http protocol depending on SSL support.

mixed
getContents(string $url)

Get the remote content.

cleanup()

Performs any cleanup necessary as the driver is not longer needed

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