PHP 클래스 FOF30\Download\Adapter\Curl

상속: extends AbstractAdapter, implements FOF30\Download\DownloadInterface
파일 보기 프로젝트 열기: akeeba/fof 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$headers

공개 메소드들

메소드 설명
__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.
getFileSize ( string $url ) : integer Get the size of a remote file in bytes

보호된 메소드들

메소드 설명
reponseHeaderCallback ( resource &$ch, string &$data ) : integer Handles the HTTP headers returned by cURL

메소드 상세

__construct() 공개 메소드

public __construct ( )

downloadAndReturn() 공개 메소드

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
리턴 string The raw file data retrieved from the remote URL.

getFileSize() 공개 메소드

Get the size of a remote file in bytes
public getFileSize ( string $url ) : integer
$url string The remote file's URL
리턴 integer The file size, or -1 if the remote server doesn't support this feature

reponseHeaderCallback() 보호된 메소드

Handles the HTTP headers returned by cURL
protected reponseHeaderCallback ( resource &$ch, string &$data ) : integer
$ch resource cURL resource handle (unused)
$data string Each header line, as returned by the server
리턴 integer The length of the $data string

프로퍼티 상세

$headers 보호되어 있는 프로퍼티

protected $headers