Documentation

DownloadManager
in package

Downloaders manager.

Tags
author

Konstantin Kudryashov ever.zet@gmail.com

Table of Contents

$downloaders  : mixed
$filesystem  : mixed
$io  : mixed
$packagePreferences  : mixed
$preferDist  : mixed
$preferSource  : mixed
__construct()  : mixed
Initializes download manager.
download()  : mixed
Downloads package into target dir.
getDownloader()  : DownloaderInterface
Returns downloader for a specific installation type.
getDownloaderForInstalledPackage()  : DownloaderInterface|null
Returns downloader for already installed package.
remove()  : mixed
Removes package from target dir.
setDownloader()  : DownloadManager
Sets installer downloader for a specific installation type.
setOutputProgress()  : DownloadManager
Sets whether to output download progress information for all registered downloaders
setPreferDist()  : DownloadManager
Makes downloader prefer dist installation over the source.
setPreferences()  : DownloadManager
Sets fine tuned preference settings for package level source/dist selection.
setPreferSource()  : DownloadManager
Makes downloader prefer source installation over the dist.
update()  : mixed
Updates package from initial to target version.
resolvePackageInstallPreference()  : string
Determines the install preference of a package

Properties

Methods

__construct()

Initializes download manager.

public __construct(IOInterface $io[, bool $preferSource = false ][, Filesystem|null $filesystem = null ]) : mixed
Parameters
$io : IOInterface

The Input Output Interface

$preferSource : bool = false

prefer downloading from source

$filesystem : Filesystem|null = null

custom Filesystem object

Return values
mixed

download()

Downloads package into target dir.

public download(PackageInterface $package, string $targetDir[, bool $preferSource = null ]) : mixed
Parameters
$package : PackageInterface

package instance

$targetDir : string

target dir

$preferSource : bool = null

prefer installation from source

Tags
throws
InvalidArgumentException

if package have no urls to download from

throws
RuntimeException
Return values
mixed

getDownloader()

Returns downloader for a specific installation type.

public getDownloader(string $type) : DownloaderInterface
Parameters
$type : string

installation type

Tags
throws
InvalidArgumentException

if downloader for provided type is not registered

Return values
DownloaderInterface

getDownloaderForInstalledPackage()

Returns downloader for already installed package.

public getDownloaderForInstalledPackage(PackageInterface $package) : DownloaderInterface|null
Parameters
$package : PackageInterface

package instance

Tags
throws
InvalidArgumentException

if package has no installation source specified

throws
LogicException

if specific downloader used to load package with wrong type

Return values
DownloaderInterface|null

setOutputProgress()

Sets whether to output download progress information for all registered downloaders

public setOutputProgress(bool $outputProgress) : DownloadManager
Parameters
$outputProgress : bool
Return values
DownloadManager

setPreferDist()

Makes downloader prefer dist installation over the source.

public setPreferDist(bool $preferDist) : DownloadManager
Parameters
$preferDist : bool

prefer downloading from dist

Return values
DownloadManager

setPreferences()

Sets fine tuned preference settings for package level source/dist selection.

public setPreferences(array<string|int, mixed> $preferences) : DownloadManager
Parameters
$preferences : array<string|int, mixed>

array of preferences by package patterns

Return values
DownloadManager

setPreferSource()

Makes downloader prefer source installation over the dist.

public setPreferSource(bool $preferSource) : DownloadManager
Parameters
$preferSource : bool

prefer downloading from source

Return values
DownloadManager

update()

Updates package from initial to target version.

public update(PackageInterface $initial, PackageInterface $target, string $targetDir) : mixed
Parameters
$initial : PackageInterface

initial package version

$target : PackageInterface

target package version

$targetDir : string

target dir

Tags
throws
InvalidArgumentException

if initial package is not installed

Return values
mixed

resolvePackageInstallPreference()

Determines the install preference of a package

protected resolvePackageInstallPreference(PackageInterface $package) : string
Parameters
$package : PackageInterface

package instance

Return values
string

Search results