class FossilDriver 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 from VcsDriver
protected $tags
protected $branches
protected $rootIdentifier
protected $repoFile
protected $checkoutDir

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.

from VcsDriver
array
getComposerInformation(string $identifier)

Return the composer.json file information

from VcsDriver
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)

checkFossil()

Check that fossil can be invoked via command line.

updateLocalRepo()

Clone or update existing local fossil repository.

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)

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

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

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)

protected checkFossil()

Check that fossil can be invoked via command line.

protected updateLocalRepo()

Clone or update existing local fossil repository.

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)

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

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