PHP Class Imdb\Request

Datei anzeigen Open project: tboothman/imdbphp Class Usage Examples

Public Methods

Method Description
__construct ( string $url, Config $config ) No need to call this.
addHeaderLine ( $name, $value )
getLastResponseHeaders ( )
getRedirect ( ) : string | null Get the URL to redirect to if a 30* was returned
getResponseBody ( ) : string Get the Response body
getStatus ( ) : integer | null HTTP status code of the last response
getresponseheader ( string $header ) : string Get a header value from the response
sendRequest ( ) : boolean Send a request to the movie site
setURL ( string $url ) Set the URL we need to parse

Private Methods

Method Description
callback_CURLOPT_HEADERFUNCTION ( $ch, $str )

Method Details

__construct() public method

No need to call this.
public __construct ( string $url, Config $config )
$url string URL to open
$config Config The Config object to use

addHeaderLine() public method

public addHeaderLine ( $name, $value )

getLastResponseHeaders() public method

getRedirect() public method

Get the URL to redirect to if a 30* was returned
public getRedirect ( ) : string | null
return string | null URL to redirect to if 300, otherwise null

getResponseBody() public method

Get the Response body
public getResponseBody ( ) : string
return string page

getStatus() public method

HTTP status code of the last response
public getStatus ( ) : integer | null
return integer | null null if last request failed

getresponseheader() public method

Get a header value from the response
public getresponseheader ( string $header ) : string
$header string header field name
return string header value

sendRequest() public method

Send a request to the movie site
public sendRequest ( ) : boolean
return boolean success

setURL() public method

Set the URL we need to parse
public setURL ( string $url )
$url string