class HgBitbucketDriver extends BitbucketDriver (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 from BitbucketDriver
protected Cache $cache from BitbucketDriver
protected $owner from BitbucketDriver
protected $repository from BitbucketDriver
protected $hasIssues from BitbucketDriver
protected $rootIdentifier from BitbucketDriver
protected $tags from BitbucketDriver
protected $branches from BitbucketDriver
protected $branchesUrl from BitbucketDriver
protected $tagsUrl from BitbucketDriver
protected $homeUrl from BitbucketDriver
protected $website from BitbucketDriver
protected $cloneHttpsUrl from BitbucketDriver
protected VcsDriver $fallbackDriver from BitbucketDriver
protected string|null $vcsType from BitbucketDriver

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

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
getUrl()

Return the URL of the repository

bool
getRepoData()

Attempts to fetch the repository data via the BitBucket API and sets some parameters which are used in other methods

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
getSource(string $identifier)

No description

array
getDist(string $identifier)

No description

array
getTags()

Return list of tags in the repository

array
getBranches()

Return list of branches in the repository

mixed
getContentsWithOAuthCredentials(string $url, bool $fetchingRepoData = false)

Get the remote content.

string
generateSshUrl()

Generate an SSH URL

attemptCloneFallback()

No description

void
setupFallbackDriver(string $url)

No description

void
parseCloneUrls(array $cloneLinks)

No description

array|null
getMainBranchData()

No description

string
getRootIdentifier()

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

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)

string getUrl()

Return the URL of the repository

Return Value

string

protected bool getRepoData()

Attempts to fetch the repository data via the BitBucket API and sets some parameters which are used in other methods

Return Value

bool

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 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.

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

protected mixed getContentsWithOAuthCredentials(string $url, bool $fetchingRepoData = false)

Get the remote content.

Parameters

string $url The URL of content
bool $fetchingRepoData

Return Value

mixed The result

protected string generateSshUrl()

Generate an SSH URL

Return Value

string

protected attemptCloneFallback()

protected void setupFallbackDriver(string $url)

Parameters

string $url

Return Value

void

protected void parseCloneUrls(array $cloneLinks)

Parameters

array $cloneLinks

Return Value

void

protected array|null getMainBranchData()

Return Value

array|null

string getRootIdentifier()

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

.)

Return Value

string Identifier

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