PHP Class FOF30\Download\Adapter\Fopen

Inheritance: extends AbstractAdapter, implements FOF30\Download\DownloadInterface
Show file Open project: akeeba/fof Class Usage Examples

Public Methods

Method Description
__construct ( )
downloadAndReturn ( string $url, integer $from = null, integer $to = null, array $params = [] ) : string Download a part (or the whole) of a remote URL and return the downloaded data. You are supposed to check the size of the returned data. If it's smaller than what you expected you've reached end of file. If it's empty you have tried reading past EOF. If it's larger than what you expected the server doesn't support chunk downloads.

Method Details

__construct() public method

public __construct ( )

downloadAndReturn() public method

If this class' supportsChunkDownload returns false you should assume that the $from and $to parameters will be ignored.
public downloadAndReturn ( string $url, integer $from = null, integer $to = null, array $params = [] ) : string
$url string The remote file's URL
$from integer Byte range to start downloading from. Use null for start of file.
$to integer Byte range to stop downloading. Use null to download the entire file ($from is ignored)
$params array Additional params that will be added before performing the download
return string The raw file data retrieved from the remote URL.