Symfony\Component\BrowserKit\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.
- Author: Fabien Potencier <fabien@symfony.com>
Synopsis
class Client
{
- // members
- protected $history;
- protected $cookieJar;
- protected $server;
- protected $internalRequest;
- protected $request;
- protected $internalResponse;
- protected $response;
- protected $crawler;
- protected $insulated;
- protected $redirect;
- protected $followRedirects;
- private $maxRedirects;
- private $redirectCount;
- private $isMainRequest;
- // methods
- public void __construct()
- public void followRedirects()
- public void setMaxRedirects()
- public void insulate()
- public void setServerParameters()
- public void setServerParameter()
- public string getServerParameter()
- public History getHistory()
- public CookieJar getCookieJar()
- public Crawler|null getCrawler()
- public Response|null getInternalResponse()
- public object|null getResponse()
- public Request|null getInternalRequest()
- public object|null getRequest()
- public Crawler click()
- public Crawler submit()
- public Crawler request()
- protected doRequestInProcess()
- protected abstract doRequest()
- protected void getScript()
- protected filterRequest()
- protected Response filterResponse()
- protected Crawler|null createCrawlerFromContent()
- public Crawler back()
- public Crawler forward()
- public Crawler reload()
- public Crawler followRedirect()
- public void restart()
- protected string getAbsoluteUri()
- protected Crawler requestFromRequest()
Hierarchy
Members
private
- $isMainRequest
- $maxRedirects
- $redirectCount
protected
- $crawler
- $followRedirects
- $history
- $insulated
- $internalRequest
- $internalResponse
- $redirect
- $request
- $response
- $server
Methods
protected
- createCrawlerFromContent() — Creates a crawler.
- doRequest() — Makes a request.
- doRequestInProcess() — Makes a request in another process.
- filterRequest() — Filters the BrowserKit request to the origin one.
- filterResponse() — Filters the origin response to the BrowserKit one.
- getAbsoluteUri() — Takes a URI and converts it to absolute if it is not already absolute.
- getScript() — Returns the script to execute when the request must be insulated.
- requestFromRequest() — Makes a request from a Request object directly.
public
- __construct() — Constructor.
- back() — Goes back in the browser history.
- click() — Clicks on a given link.
- followRedirect() — Follow redirects?
- followRedirects() — Sets whether to automatically follow redirects or not.
- forward() — Goes forward in the browser history.
- getCookieJar() — Returns the CookieJar instance.
- getCrawler() — Returns the current Crawler instance.
- getHistory() — Returns the History instance.
- getInternalRequest() — Returns the current BrowserKit Request instance.
- getInternalResponse() — Returns the current BrowserKit Response instance.
- getRequest() — Returns the current origin Request instance.
- getResponse() — Returns the current origin response instance.
- getServerParameter() — Gets single server parameter for specified key.
- insulate() — Sets the insulated flag.
- reload() — Reloads the current browser.
- request() — Calls a URI.
- restart() — Restarts the client.
- setMaxRedirects() — Sets the maximum number of requests that crawler can follow.
- setServerParameter() — Sets single server parameter.
- setServerParameters() — Sets server parameters.
- submit() — Submits a form.