Composer API
Class

Composer\Downloader\FileDownloader

class FileDownloader implements DownloaderInterface

Base downloader for files

Methods

__construct(IOInterface $io, Config $config, EventDispatcher $eventDispatcher = null, Cache $cache = null, RemoteFilesystem $rfs = null, Filesystem $filesystem = null)

Constructor.

string getInstallationSource()

Returns installation source (either source or dist).

download(PackageInterface $package, string $path, $output = true)

Downloads specific package into specific folder.

DownloaderInterface setOutputProgress(bool $outputProgress)

Sets whether to output download progress information or not

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

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

remove(PackageInterface $package, string $path, $output = true)

Removes specific package from specific folder.

Details

at line 55
public __construct(IOInterface $io, Config $config, EventDispatcher $eventDispatcher = null, Cache $cache = null, RemoteFilesystem $rfs = null, Filesystem $filesystem = null)

Constructor.

Parameters

IOInterface $io The IO instance
Config $config The config
EventDispatcher $eventDispatcher The event dispatcher
Cache $cache Optional cache instance
RemoteFilesystem $rfs The remote filesystem
Filesystem $filesystem The filesystem

at line 72
public string getInstallationSource()

Returns installation source (either source or dist).

Return Value

string "source" or "dist"

at line 80
public download(PackageInterface $package, string $path, $output = true)

Downloads specific package into specific folder.

Parameters

PackageInterface $package package instance
string $path download path
$output

at line 192
public DownloaderInterface setOutputProgress(bool $outputProgress)

Sets whether to output download progress information or not

Parameters

bool $outputProgress

Return Value

DownloaderInterface

at line 210
public 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

at line 227
public remove(PackageInterface $package, string $path, $output = true)

Removes specific package from specific folder.

Parameters

PackageInterface $package package instance
string $path download path
$output