PHP Class Gush\Helper\DownloadHelper

Some parts were borrowed from the symfony-installer.
Inheritance: extends Symfony\Component\Console\Helper\Helper, implements Gush\Helper\OutputAwareInterface
Show file Open project: gushphp/gush

Public Methods

Method Description
__construct ( FilesystemHelper $filesystemHelper )
downloadFile ( string $url, boolean $progress = true ) Download a file from the URL to the destination.
getName ( )
setOutput ( Symfony\Component\Console\Output\OutputInterface $output )

Protected Methods

Method Description
getGuzzleClient ( ) : Client Returns the Guzzle client configured according to the system environment (e.g. it takes into account whether it should use a proxy server or not).

Private Methods

Method Description
formatSize ( integer $bytes ) : string Utility method to show the number of bytes in a readable format.

Method Details

__construct() public method

public __construct ( FilesystemHelper $filesystemHelper )
$filesystemHelper FilesystemHelper

downloadFile() public method

Download a file from the URL to the destination.
public downloadFile ( string $url, boolean $progress = true )
$url string Fully qualified URL to the file.
$progress boolean Show the progressbar when downloading.

getGuzzleClient() protected method

Returns the Guzzle client configured according to the system environment (e.g. it takes into account whether it should use a proxy server or not).
protected getGuzzleClient ( ) : Client
return GuzzleHttp\Client

getName() public method

public getName ( )

setOutput() public method

public setOutput ( Symfony\Component\Console\Output\OutputInterface $output )
$output Symfony\Component\Console\Output\OutputInterface