Properties

$io

$io : 

Type

$preferDist

$preferDist : 

Type

$preferSource

$preferSource : 

Type

$packagePreferences

$packagePreferences : 

Type

$filesystem

$filesystem : 

Type

$downloaders

$downloaders : 

Type

Methods

__construct()

__construct(\Composer\IO\IOInterface  $io, boolean  $preferSource = false, \Composer\Util\Filesystem|null  $filesystem = null) 

Initializes download manager.

Parameters

\Composer\IO\IOInterface $io

The Input Output Interface

boolean $preferSource

prefer downloading from source

\Composer\Util\Filesystem|null $filesystem

custom Filesystem object

setPreferSource()

setPreferSource(boolean  $preferSource) : \Composer\Downloader\DownloadManager

Makes downloader prefer source installation over the dist.

Parameters

boolean $preferSource

prefer downloading from source

Returns

\Composer\Downloader\DownloadManager

setPreferDist()

setPreferDist(boolean  $preferDist) : \Composer\Downloader\DownloadManager

Makes downloader prefer dist installation over the source.

Parameters

boolean $preferDist

prefer downloading from dist

Returns

\Composer\Downloader\DownloadManager

setPreferences()

setPreferences(array  $preferences) : \Composer\Downloader\DownloadManager

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

Parameters

array $preferences

array of preferences by package patterns

Returns

\Composer\Downloader\DownloadManager

setOutputProgress()

setOutputProgress(boolean  $outputProgress) : \Composer\Downloader\DownloadManager

Sets whether to output download progress information for all registered downloaders

Parameters

boolean $outputProgress

Returns

\Composer\Downloader\DownloadManager

getDownloader()

getDownloader(string  $type) : \Composer\Downloader\DownloaderInterface

Returns downloader for a specific installation type.

Parameters

string $type

installation type

Throws

\InvalidArgumentException

if downloader for provided type is not registered

Returns

\Composer\Downloader\DownloaderInterface

getDownloaderForInstalledPackage()

getDownloaderForInstalledPackage(\Composer\Package\PackageInterface  $package) : \Composer\Downloader\DownloaderInterface|null

Returns downloader for already installed package.

Parameters

\Composer\Package\PackageInterface $package

package instance

Throws

\InvalidArgumentException

if package has no installation source specified

\LogicException

if specific downloader used to load package with wrong type

Returns

\Composer\Downloader\DownloaderInterface|null

download()

download(\Composer\Package\PackageInterface  $package, string  $targetDir, boolean  $preferSource = null) 

Downloads package into target dir.

Parameters

\Composer\Package\PackageInterface $package

package instance

string $targetDir

target dir

boolean $preferSource

prefer installation from source

Throws

\InvalidArgumentException

if package have no urls to download from

\RuntimeException

update()

update(\Composer\Package\PackageInterface  $initial, \Composer\Package\PackageInterface  $target, string  $targetDir) 

Updates package from initial to target version.

Parameters

\Composer\Package\PackageInterface $initial

initial package version

\Composer\Package\PackageInterface $target

target package version

string $targetDir

target dir

Throws

\InvalidArgumentException

if initial package is not installed

remove()

remove(\Composer\Package\PackageInterface  $package, string  $targetDir) 

Removes package from target dir.

Parameters

\Composer\Package\PackageInterface $package

package instance

string $targetDir

target dir

resolvePackageInstallPreference()

resolvePackageInstallPreference(\Composer\Package\PackageInterface  $package) : string

Determines the install preference of a package

Parameters

\Composer\Package\PackageInterface $package

package instance

Returns

string