class TarDownloader extends ArchiveDownloader (View source)

Downloader for tar files: tar, tar.gz or tar.bz2

Properties

protected $io from FileDownloader
protected $config from FileDownloader
protected $rfs from FileDownloader
protected $filesystem from FileDownloader
protected $cache from FileDownloader
protected $outputProgress from FileDownloader

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.

doDownload(PackageInterface $package, $path, $url)

No description

setOutputProgress(bool $outputProgress)

Sets whether to output download progress information or not

clearLastCacheWrite(PackageInterface $package)

No description

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.

string
getFileName(PackageInterface $package, string $path)

Gets file name for specific package

string
processUrl(PackageInterface $package, string $url)

Process the download url

extract(string $file, string $path)

Extract file to directory

Details

__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

string getInstallationSource()

Returns installation source (either source or dist).

Return Value

string "source" or "dist"

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

Downloads specific package into specific folder.

Parameters

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

protected doDownload(PackageInterface $package, $path, $url)

Parameters

PackageInterface $package
$path
$url

DownloaderInterface setOutputProgress(bool $outputProgress)

Sets whether to output download progress information or not

Parameters

bool $outputProgress

Return Value

DownloaderInterface

protected clearLastCacheWrite(PackageInterface $package)

Parameters

PackageInterface $package

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

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

Removes specific package from specific folder.

Parameters

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

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

Gets file name for specific package

Parameters

PackageInterface $package package instance
string $path download path

Return Value

string file name

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

Process the download url

Parameters

PackageInterface $package package the url is coming from
string $url download url

Return Value

string url

Exceptions

RuntimeException If any problem with the url

protected extract(string $file, string $path)

Extract file to directory

Parameters

string $file Extracted file
string $path Directory

Exceptions

UnexpectedValueException If can not extract downloaded file to path