RarDownloader
extends ArchiveDownloader
in package
RAR archive downloader.
Based on previous work by Jordi Boggiano (ZipDownloader).
Tags
Table of Contents
- $cache : mixed
- $config : mixed
- $filesystem : mixed
- $io : mixed
- $outputProgress : mixed
- $process : mixed
- $rfs : mixed
- $eventDispatcher : mixed
- $lastCacheWrites : mixed
- __construct() : mixed
- 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
- extract() : mixed
- Extract file to directory
- getFileName() : string
- Gets file name for specific package
- processUrl() : string
- Process the download url
- getCacheKey() : mixed
- getFolderContent() : array<string|int, SplFileInfo>
- Returns the folder content, excluding dotfiles
Properties
$cache
protected
mixed
$cache
$config
protected
mixed
$config
$filesystem
protected
mixed
$filesystem
$io
protected
mixed
$io
$outputProgress
protected
mixed
$outputProgress
= true
$process
protected
mixed
$process
$rfs
protected
mixed
$rfs
$eventDispatcher
private
mixed
$eventDispatcher
$lastCacheWrites
private
mixed
$lastCacheWrites
= array()
Methods
__construct()
public
__construct(IOInterface $io, Config $config[, EventDispatcher $eventDispatcher = null ][, Cache $cache = null ][, ProcessExecutor $process = null ][, RemoteFilesystem $rfs = null ]) : mixed
Parameters
- $io : IOInterface
- $config : Config
- $eventDispatcher : EventDispatcher = null
- $cache : Cache = null
- $process : ProcessExecutor = null
- $rfs : RemoteFilesystem = null
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
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 —setOutputProgress()
Sets whether to output download progress information or not
public
setOutputProgress(mixed $outputProgress) : DownloaderInterface
Parameters
- $outputProgress : mixed
Return values
DownloaderInterface —update()
Updates specific package in specific folder from initial to target version.
public
update(PackageInterface $initial, PackageInterface $target, mixed $path) : mixed
Parameters
- $initial : PackageInterface
-
initial package
- $target : PackageInterface
-
updated package
- $path : mixed
-
download path
Return values
mixed —clearLastCacheWrite()
protected
clearLastCacheWrite(PackageInterface $package) : mixed
Parameters
- $package : PackageInterface
Return values
mixed —doDownload()
protected
doDownload(PackageInterface $package, mixed $path, mixed $url) : mixed
Parameters
- $package : PackageInterface
- $path : mixed
- $url : mixed
Return values
mixed —extract()
Extract file to directory
protected
extract(mixed $file, mixed $path) : mixed
Parameters
- $file : mixed
-
Extracted file
- $path : mixed
-
Directory
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
Return values
string —url
getCacheKey()
private
getCacheKey(PackageInterface $package, mixed $processedUrl) : mixed
Parameters
- $package : PackageInterface
- $processedUrl : mixed
Return values
mixed —getFolderContent()
Returns the folder content, excluding dotfiles
private
getFolderContent(string $dir) : array<string|int, SplFileInfo>
Parameters
- $dir : string
-
Directory