Client
class Client extends Client
Client simulates a browser and makes requests to a Kernel object.
Methods
Constructor.
Sets whether to automatically follow redirects or not.
Returns whether client automatically follows redirects or not.
Sets the maximum number of requests that crawler can follow.
Gets single server parameter for specified key.
Calls a URI.
Returns the container.
Returns the kernel.
Gets the profile associated with the current Response.
Enables the profiler for the very next request.
Disables kernel reboot between requests.
Enables kernel reboot between requests.
Details
at line line 37
__construct(HttpKernelInterface $kernel, array $server = array(), History $history = null, CookieJar $cookieJar = null)
Constructor.
in Client at line line 66
followRedirects(bool $followRedirect = true)
Sets whether to automatically follow redirects or not.
in Client at line line 76
bool
isFollowingRedirects()
Returns whether client automatically follows redirects or not.
in Client at line line 86
setMaxRedirects(int $maxRedirects)
Sets the maximum number of requests that crawler can follow.
in Client at line line 97
int
getMaxRedirects()
Returns the maximum number of requests that crawler can follow.
in Client at line line 109
insulate(bool $insulated = true)
Sets the insulated flag.
in Client at line line 123
setServerParameters(array $server)
Sets server parameters.
in Client at line line 137
setServerParameter(string $key, string $value)
Sets single server parameter.
in Client at line line 150
string
getServerParameter(string $key, string $default = '')
Gets single server parameter for specified key.
in Client at line line 190
Response|null
getInternalResponse()
Returns the current BrowserKit Response instance.
in Client at line line 65
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.
in Client at line line 215
Request|null
getInternalRequest()
Returns the current BrowserKit Request instance.
in Client at line line 55
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.
in Client at line line 279
Crawler
request(string $method, string $uri, array $parameters = array(), array $files = array(), array $server = array(), string $content = null, bool $changeHistory = true)
Calls a URI.
in Client at line line 513
restart()
Restarts the client.
It flushes history and all cookies.
at line line 47
ContainerInterface
getContainer()
Returns the container.
at line line 57
KernelInterface
getKernel()
Returns the kernel.
at line line 67
Profile
getProfile()
Gets the profile associated with the current Response.
at line line 81
enableProfiler()
Enables the profiler for the very next request.
If the profiler is not enabled, the call to this method does nothing.
at line line 94
disableReboot()
Disables kernel reboot between requests.
By default, the Client reboots the Kernel for each request. This method allows to keep the same kernel across requests.
at line line 102
enableReboot()
Enables kernel reboot between requests.