\CHttpGet

Get a image from a remote server using HTTP GET and If-Modified-Since.

Summary

Methods
Properties
Constants
__construct()
buildUrl()
setUrl()
setHeader()
parseHeader()
doGet()
getStatus()
getLastModified()
getContentType()
getDate()
getMaxAge()
getBody()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$request
$response
N/A

Properties

$request

$request : 

Type

$response

$response : 

Type

Methods

__construct()

__construct() 

Constructor

buildUrl()

buildUrl(string  $baseUrl, string  $merge) : string

Build an encoded url.

Parameters

string $baseUrl

This is the original url which will be merged.

string $merge

Thse parts should be merged into the baseUrl, the format is as parse_url.

Returns

string —

$url as the modified url.

setUrl()

setUrl(string  $url) : $this

Set the url for the request.

Parameters

string $url

Returns

$this

setHeader()

setHeader(string  $field, string  $value) : $this

Set custom header field for the request.

Parameters

string $field
string $value

Returns

$this

parseHeader()

parseHeader() : $this

Set header fields for the request.

Returns

$this

doGet()

doGet(boolean  $debug = false) : boolean

Perform the request.

Parameters

boolean $debug

set to true to dump headers.

Throws

\Exception

when curl fails to retrieve url.

Returns

boolean

getStatus()

getStatus() : integer

Get HTTP code of response.

Returns

integer —

as HTTP status code or null if not available.

getLastModified()

getLastModified() : integer

Get file modification time of response.

Returns

integer —

as timestamp.

getContentType()

getContentType() : string

Get content type.

Returns

string —

as the content type or null if not existing or invalid.

getDate()

getDate(mixed  $default = false) : integer

Get file modification time of response.

Parameters

mixed $default

as default value (int seconds) if date is missing in response header.

Returns

integer —

as timestamp or $default if Date is missing in response header.

getMaxAge()

getMaxAge(mixed  $default = false) : integer

Get max age of cachable item.

Parameters

mixed $default

as default value if date is missing in response header.

Returns

integer —

as timestamp or false if not available.

getBody()

getBody() : string

Get body of response.

Returns

string —

as body.