Documentation

FileDownloader
in package
implements DownloaderInterface, ChangeReportInterface

Base downloader for files

Tags
author

Kirill chEbba Chebunin iam@chebba.org

author

Jordi Boggiano j.boggiano@seld.be

author

François Pluchino francois.pluchino@opendisplay.com

author

Nils Adermann naderman@naderman.de

Interfaces, Classes and Traits

DownloaderInterface
Downloader interface.
ChangeReportInterface
ChangeReport interface.

Table of Contents

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

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

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

Search results