PHP 클래스 FOF30\Download\Adapter\AbstractAdapter

상속: implements FOF30\Download\DownloadInterface
파일 보기 프로젝트 열기: akeeba/fof

공개 프로퍼티들

프로퍼티 타입 설명
$isSupported boolean Is this adapter supported in the current execution environment?
$name string Name of the adapter (identical to filename)
$priority integer Load order priority
$supportsChunkDownload boolean Does this adapter support chunked downloads?
$supportsFileSize boolean Does this adapter support querying the remote file's size?

공개 메소드들

메소드 설명
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
getName ( ) : string Returns the name of this download adapter in use
getPriority ( ) : boolean Get the priority of this adapter. If multiple download adapters are supported on a site, the one with the highest priority will be used.
isSupported ( ) : boolean Is this download class supported in the current server environment?
supportsChunkDownload ( ) : boolean Does this download adapter support downloading files in chunks?
supportsFileSize ( ) : boolean Does this download adapter support reading the size of a remote file?

메소드 상세

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

getName() 공개 메소드

Returns the name of this download adapter in use
public getName ( ) : string
리턴 string

getPriority() 공개 메소드

Get the priority of this adapter. If multiple download adapters are supported on a site, the one with the highest priority will be used.
public getPriority ( ) : boolean
리턴 boolean

isSupported() 공개 메소드

Is this download class supported in the current server environment?
public isSupported ( ) : boolean
리턴 boolean True if this server environment supports this download class

supportsChunkDownload() 공개 메소드

Does this download adapter support downloading files in chunks?
public supportsChunkDownload ( ) : boolean
리턴 boolean True if chunk download is supported

supportsFileSize() 공개 메소드

Does this download adapter support reading the size of a remote file?
public supportsFileSize ( ) : boolean
리턴 boolean True if remote file size determination is supported

프로퍼티 상세

$isSupported 공개적으로 프로퍼티

Is this adapter supported in the current execution environment?
public bool $isSupported
리턴 boolean

$name 공개적으로 프로퍼티

Name of the adapter (identical to filename)
public string $name
리턴 string

$priority 공개적으로 프로퍼티

Load order priority
public int $priority
리턴 integer

$supportsChunkDownload 공개적으로 프로퍼티

Does this adapter support chunked downloads?
public bool $supportsChunkDownload
리턴 boolean

$supportsFileSize 공개적으로 프로퍼티

Does this adapter support querying the remote file's size?
public bool $supportsFileSize
리턴 boolean