Documentation

PathDownloader extends FileDownloader
in package
implements VcsCapableDownloaderInterface

Download a package from a local path.

Tags
author

Samuel Roze samuel.roze@gmail.com

author

Johann Reinke johann.reinke@gmail.com

Interfaces, Classes and Traits

VcsCapableDownloaderInterface
VCS Capable Downloader interface.

Table of Contents

STRATEGY_MIRROR  = 20
STRATEGY_SYMLINK  = 10
$cache  : mixed
$config  : mixed
$filesystem  : mixed
$io  : mixed
$outputProgress  : mixed
$rfs  : mixed
$eventDispatcher  : mixed
$lastCacheWrites  : mixed
__construct()  : mixed
Constructor.
download()  : mixed
Downloads specific package into specific folder.
getInstallationSource()  : string
Returns installation source (either source or dist).
getLocalChanges()  : string|null
Checks for changes to the local copy
getVcsReference()  : string|null
Gets the VCS Reference for the package at path
remove()  : mixed
Removes specific package from specific folder.
setOutputProgress()  : DownloaderInterface
Sets whether to output download progress information or not
update()  : mixed
Updates specific package in specific folder from initial to target version.
clearLastCacheWrite()  : mixed
doDownload()  : mixed
getFileName()  : string
Gets file name for specific package
processUrl()  : string
Process the download url
getCacheKey()  : mixed
safeJunctions()  : bool
Returns true if junctions can be created and safely used on Windows

Constants

Properties

Methods

__construct()

Constructor.

public __construct(IOInterface $io, Config $config[, EventDispatcher $eventDispatcher = null ][, Cache $cache = null ][, RemoteFilesystem $rfs = null ][, Filesystem $filesystem = null ]) : mixed
Parameters
$io : IOInterface

The IO instance

$config : Config

The config

$eventDispatcher : EventDispatcher = null

The event dispatcher

$cache : Cache = null

Optional cache instance

$rfs : RemoteFilesystem = null

The remote filesystem

$filesystem : Filesystem = null

The filesystem

Return values
mixed —

download()

Downloads specific package into specific folder.

public download(PackageInterface $package, mixed $path[, mixed $output = true ]) : mixed
Parameters
$package : PackageInterface

package instance

$path : mixed

download path

$output : mixed = true
Return values
mixed —

getInstallationSource()

Returns installation source (either source or dist).

public getInstallationSource() : string
Return values
string —

"source" or "dist"

getLocalChanges()

Checks for changes to the local copy

public getLocalChanges(PackageInterface $package, mixed $targetDir) : string|null
Parameters
$package : PackageInterface

package instance

$targetDir : mixed
Tags
throws
RuntimeException
Return values
string|null —

changes or null

getVcsReference()

Gets the VCS Reference for the package at path

public getVcsReference(PackageInterface $package, mixed $path) : string|null
Parameters
$package : PackageInterface

package directory

$path : mixed

package directory

Return values
string|null —

reference or null

remove()

Removes specific package from specific folder.

public remove(PackageInterface $package, mixed $path[, mixed $output = true ]) : mixed
Parameters
$package : PackageInterface

package instance

$path : mixed

download path

$output : mixed = true
Return values
mixed —

getFileName()

Gets file name for specific package

protected getFileName(PackageInterface $package, string $path) : string
Parameters
$package : PackageInterface

package instance

$path : string

download path

Return values
string —

file name

processUrl()

Process the download url

protected processUrl(PackageInterface $package, string $url) : string
Parameters
$package : PackageInterface

package the url is coming from

$url : string

download url

Tags
throws
RuntimeException

If any problem with the url

Return values
string —

url

safeJunctions()

Returns true if junctions can be created and safely used on Windows

private safeJunctions() : bool

A PHP bug makes junction detection fragile, leading to possible data loss when removing a package. See https://bugs.php.net/bug.php?id=77552

For safety we require a minimum version of Windows 7, so we can call the system rmdir which will preserve target content if given a junction.

The PHP bug was fixed in 7.2.16 and 7.3.3 (requires at least Windows 7).

Return values
bool —

Search results