abstract class VcsDownloader implements DownloaderInterface, ChangeReportInterface, VcsCapableDownloaderInterface (View source)

Properties

protected IOInterface $io
protected Config $config
protected ProcessExecutor $process
protected Filesystem $filesystem

Methods

__construct(IOInterface $io, Config $config, ProcessExecutor $process = null, Filesystem $fs = null)

No description

string
getInstallationSource()

Returns installation source (either source or dist).

download(PackageInterface $package, string $path)

Downloads specific package into specific folder.

update(PackageInterface $initial, PackageInterface $target, string $path)

Updates specific package in specific folder from initial to target version.

remove(PackageInterface $package, string $path)

Removes specific package from specific folder.

setOutputProgress(bool $outputProgress)

Download progress information is not available for all VCS downloaders.

string|null
getVcsReference(PackageInterface $package, string $path)

Gets the VCS Reference for the package at path

cleanChanges(PackageInterface $package, string $path, bool $update)

Prompt the user to check if changes should be stashed/removed or the operation aborted

reapplyChanges(string $path)

Guarantee that no changes have been made to the local copy

doDownload(PackageInterface $package, string $path, string $url)

Downloads specific package into specific folder.

doUpdate(PackageInterface $initial, PackageInterface $target, string $path, string $url)

Updates specific package in specific folder from initial to target version.

string
getCommitLogs(string $fromReference, string $toReference, string $path)

Fetches the commit logs between two commits

bool
hasMetadataRepository(string $path)

Checks if VCS metadata repository has been initialized repository example: .git|.svn|.hg

Details

__construct(IOInterface $io, Config $config, ProcessExecutor $process = null, Filesystem $fs = null)

Parameters

IOInterface $io
Config $config
ProcessExecutor $process
Filesystem $fs

string getInstallationSource()

Returns installation source (either source or dist).

Return Value

string "source" or "dist"

download(PackageInterface $package, string $path)

Downloads specific package into specific folder.

Parameters

PackageInterface $package package instance
string $path download path

update(PackageInterface $initial, PackageInterface $target, string $path)

Updates specific package in specific folder from initial to target version.

Parameters

PackageInterface $initial initial package
PackageInterface $target updated package
string $path download path

remove(PackageInterface $package, string $path)

Removes specific package from specific folder.

Parameters

PackageInterface $package package instance
string $path download path

DownloaderInterface setOutputProgress(bool $outputProgress)

Download progress information is not available for all VCS downloaders.

{@inheritDoc}

Parameters

bool $outputProgress

Return Value

DownloaderInterface

string|null getVcsReference(PackageInterface $package, string $path)

Gets the VCS Reference for the package at path

Parameters

PackageInterface $package package directory
string $path package directory

Return Value

string|null reference or null

protected cleanChanges(PackageInterface $package, string $path, bool $update)

Prompt the user to check if changes should be stashed/removed or the operation aborted

Parameters

PackageInterface $package
string $path
bool $update if true (update) the changes can be stashed and reapplied after an update, if false (remove) the changes should be assumed to be lost if the operation is not aborted

Exceptions

RuntimeException in case the operation must be aborted

protected reapplyChanges(string $path)

Guarantee that no changes have been made to the local copy

Parameters

string $path

Exceptions

RuntimeException in case the operation must be aborted or the patch does not apply cleanly

abstract protected doDownload(PackageInterface $package, string $path, string $url)

Downloads specific package into specific folder.

Parameters

PackageInterface $package package instance
string $path download path
string $url package url

abstract protected doUpdate(PackageInterface $initial, PackageInterface $target, string $path, string $url)

Updates specific package in specific folder from initial to target version.

Parameters

PackageInterface $initial initial package
PackageInterface $target updated package
string $path download path
string $url package url

abstract protected string getCommitLogs(string $fromReference, string $toReference, string $path)

Fetches the commit logs between two commits

Parameters

string $fromReference the source reference
string $toReference the target reference
string $path the package path

Return Value

string

abstract protected bool hasMetadataRepository(string $path)

Checks if VCS metadata repository has been initialized repository example: .git|.svn|.hg

Parameters

string $path

Return Value

bool