Client
class Client
Client simulates a browser.
To make the actual request, you need to implement the doRequest() method.
If you want to be able to run requests in their own process (insulated flag), you need to also implement the getScript() method.
Methods
No description
Sets whether to automatically follow redirects or not.
Returns whether client automatically follows redirects or not.
Sets the maximum number of redirects that crawler can follow.
Returns the maximum number of redirects that crawler can follow.
Sets the insulated flag.
Sets server parameters.
Sets single server parameter.
Gets single server parameter for specified key.
Returns the History instance.
Returns the CookieJar instance.
Returns the current Crawler instance.
Returns the current BrowserKit Response instance.
Returns the current origin response instance.
Returns the current BrowserKit Request instance.
Returns the current origin Request instance.
Calls a URI.
Follow redirects?
Restarts the client.
Details
at line line 53
__construct(array $server = array(), History $history = null, CookieJar $cookieJar = null)
at line line 65
followRedirects(bool $followRedirect = true)
Sets whether to automatically follow redirects or not.
at line line 75
bool
isFollowingRedirects()
Returns whether client automatically follows redirects or not.
at line line 85
setMaxRedirects(int $maxRedirects)
Sets the maximum number of redirects that crawler can follow.
at line line 96
int
getMaxRedirects()
Returns the maximum number of redirects that crawler can follow.
at line line 108
insulate(bool $insulated = true)
Sets the insulated flag.
at line line 122
setServerParameters(array $server)
Sets server parameters.
at line line 135
setServerParameter(string $key, string $value)
Sets single server parameter.
at line line 148
string
getServerParameter(string $key, string $default = '')
Gets single server parameter for specified key.
at line line 158
History
getHistory()
Returns the History instance.
at line line 168
CookieJar
getCookieJar()
Returns the CookieJar instance.
at line line 178
Crawler|null
getCrawler()
Returns the current Crawler instance.
at line line 188
Response|null
getInternalResponse()
Returns the current BrowserKit Response instance.
at line line 203
object|null
getResponse()
Returns the current origin response instance.
The origin response is the response instance that is returned by the code that handles requests.
at line line 213
Request|null
getInternalRequest()
Returns the current BrowserKit Request instance.
at line line 228
object|null
getRequest()
Returns the current origin Request instance.
The origin request is the request instance that is sent to the code that handles requests.
at line line 275
Crawler
request(string $method, string $uri, array $parameters = array(), array $files = array(), array $server = array(), string $content = null, bool $changeHistory = true)
Calls a URI.
at line line 445
Crawler
back()
Goes back in the browser history.
at line line 459
Crawler
forward()
Goes forward in the browser history.
at line line 473
Crawler
reload()
Reloads the current browser.
at line line 485
Crawler
followRedirect()
Follow redirects?
at line line 534
restart()
Restarts the client.
It flushes history and all cookies.