Method | Description | |
---|---|---|
__construct ( ) | Starts with no cookies, realms or proxies. | |
addHeader ( string $header ) | Adds a header to every fetch. | |
ageCookies ( integer $interval ) | Ages the cookies by the specified time. | |
fetchResponse ( string/SimpleUrl $url, SimpleEncoding $encoding ) : SimpleHttpResponse | Fetches a URL as a response object. Will keep trying if redirected. | |
getBaseCookieValue ( string $name, SimpleUrl $base ) : string/boolean | Reads the current cookies within the base URL. | |
getCookieValue ( string $host, string $path, string $name ) : string | Reads the most specific cookie value from the browser cookies. | |
ignoreCookies ( ) | Switches off cookie sending and recieving. | |
restart ( string/integer $date = false ) | Removes expired and temporary cookies as if the browser was closed and re-opened. | |
setConnectionTimeout ( integer $timeout ) | Sets the socket timeout for opening a connection. | |
setCookie ( string $name, string $value, string $host = false, string $path = '/', string $expiry = false ) | Sets an additional cookie. If a cookie has the same name and path it is replaced. | |
setIdentity ( string $host, string $realm, string $username, string $password ) | Sets the identity for the current realm. | |
setMaximumRedirects ( integer $max ) | Sets the maximum number of redirects before a page will be loaded anyway. | |
setReferer ( string $referer ) | Sets the referrer to send with the request, as long as it is not set explicitely via {@link addHeader()}. | |
useCookies ( ) | Switches back on the cookie sending and recieving. | |
useProxy ( string $proxy, string $username, string $password ) | Sets proxy to use on all requests for when testing from behind a firewall. |
Method | Description | |
---|---|---|
addAdditionalHeaders ( SimpleHttpRequest &$request ) | Adds additional manual headers. | |
createHttpRequest ( SimpleUrl $url, $encoding ) : SimpleHttpRequest | Builds the appropriate HTTP request object. | |
createRequest ( SimpleUrl $url, SimpleFormEncoding $encoding ) : SimpleHttpRequest | Creates a full page request. | |
createRoute ( SimpleUrl $url ) : SimpleRoute | Sets up either a direct route or via a proxy. | |
fetch ( SimpleUrl $url, SimpleFormEncoding $encoding ) : SimpleHttpResponse | Actually make the web request. | |
fetchWhileRedirected ( SimpleUrl $url, SimpelFormEncoding $encoding ) : SimpleHttpResponse | Fetches the page until no longer redirected or until the redirect limit runs out. | |
isTooManyRedirects ( integer $redirects ) : boolean | Test to see if the redirect limit is passed. |
protected addAdditionalHeaders ( SimpleHttpRequest &$request ) | ||
$request | SimpleHttpRequest | Outgoing request. |
public ageCookies ( integer $interval ) | ||
$interval | integer | Amount in seconds. |
protected createHttpRequest ( SimpleUrl $url, $encoding ) : SimpleHttpRequest | ||
$url | SimpleUrl | Target to fetch as url object. |
return | SimpleHttpRequest | New request object. |
protected createRequest ( SimpleUrl $url, SimpleFormEncoding $encoding ) : SimpleHttpRequest | ||
$url | SimpleUrl | Target to fetch as url object. |
$encoding | SimpleFormEncoding | POST/GET parameters. |
return | SimpleHttpRequest | New request. |
protected createRoute ( SimpleUrl $url ) : SimpleRoute | ||
$url | SimpleUrl | Target to fetch as url object. |
return | SimpleRoute | Route to take to fetch URL. |
protected fetch ( SimpleUrl $url, SimpleFormEncoding $encoding ) : SimpleHttpResponse | ||
$url | SimpleUrl | Target to fetch. |
$encoding | SimpleFormEncoding | Additional parameters for request. |
return | SimpleHttpResponse | Headers and hopefully content. |
public fetchResponse ( string/SimpleUrl $url, SimpleEncoding $encoding ) : SimpleHttpResponse | ||
$url | string/SimpleUrl | |
$encoding | SimpleEncoding | Additional parameters for request. |
return | SimpleHttpResponse | Hopefully the target page. |
protected fetchWhileRedirected ( SimpleUrl $url, SimpelFormEncoding $encoding ) : SimpleHttpResponse | ||
$url | SimpleUrl | Target to fetch. |
$encoding | SimpelFormEncoding | Additional parameters for request. |
return | SimpleHttpResponse | Hopefully the target page. |
public getBaseCookieValue ( string $name, SimpleUrl $base ) : string/boolean | ||
$name | string | Key of cookie to find. |
$base | SimpleUrl | Base URL to search from. |
return | string/boolean |
protected isTooManyRedirects ( integer $redirects ) : boolean | ||
$redirects | integer | Count so far. |
return | boolean | True if over. |
public restart ( string/integer $date = false ) | ||
$date | string/integer |
public setConnectionTimeout ( integer $timeout ) | ||
$timeout | integer | Maximum time in seconds. |
public setMaximumRedirects ( integer $max ) | ||
$max | integer | Most hops allowed. |
public setReferer ( string $referer ) | ||
$referer | string | Referer URI to add to every request until cleared. |