| [ Index ] |
|
Code source de PRADO 3.0.6 |
[Code source] [Imprimer] [Statistiques]
Base include file for SimpleTest
| Version: | $Id: user_agent.php 1397 2006-09-07 07:55:53Z wei $ |
| Poids: | 333 lignes (13 kb) |
| Inclus ou requis: | 0 fois |
| Référencé: | 0 fois |
| Nécessite: | 0 fichiers |
SimpleUserAgent:: (21 méthodes):
SimpleUserAgent()
restart()
addHeader()
ageCookies()
setCookie()
getCookieValue()
getBaseCookieValue()
ignoreCookies()
useCookies()
setConnectionTimeout()
setMaximumRedirects()
useProxy()
_isTooManyRedirects()
setIdentity()
fetchResponse()
_fetchWhileRedirected()
_fetch()
_createRequest()
_createHttpRequest()
_createRoute()
_addAdditionalHeaders()
Classe: SimpleUserAgent - X-Ref
Fetches web pages whilst keeping track of| SimpleUserAgent() X-Ref |
| Starts with no cookies, realms or proxies. |
| restart($date = false) X-Ref |
| Removes expired and temporary cookies as if the browser was closed and re-opened. Authorisation has to be obtained again as well. param: string/integer $date Time when session restarted. |
| addHeader($header) X-Ref |
| Adds a header to every fetch. param: string $header Header line to add to every |
| ageCookies($interval) X-Ref |
| Ages the cookies by the specified time. param: integer $interval Amount in seconds. |
| setCookie($name, $value, $host = false, $path = '/', $expiry = false) X-Ref |
| Sets an additional cookie. If a cookie has the same name and path it is replaced. param: string $name Cookie key. param: string $value Value of cookie. param: string $host Host upon which the cookie is valid. param: string $path Cookie path if not host wide. param: string $expiry Expiry date. |
| getCookieValue($host, $path, $name) X-Ref |
| Reads the most specific cookie value from the browser cookies. param: string $host Host to search. param: string $path Applicable path. param: string $name Name of cookie to read. return: string False if not present, else the |
| getBaseCookieValue($name, $base) X-Ref |
| Reads the current cookies within the base URL. param: string $name Key of cookie to find. param: SimpleUrl $base Base URL to search from. return: string/boolean Null if there is no base URL, false |
| ignoreCookies() X-Ref |
| Switches off cookie sending and recieving. |
| useCookies() X-Ref |
| Switches back on the cookie sending and recieving. |
| setConnectionTimeout($timeout) X-Ref |
| Sets the socket timeout for opening a connection. param: integer $timeout Maximum time in seconds. |
| setMaximumRedirects($max) X-Ref |
| Sets the maximum number of redirects before a page will be loaded anyway. param: integer $max Most hops allowed. |
| useProxy($proxy, $username, $password) X-Ref |
| Sets proxy to use on all requests for when testing from behind a firewall. Set URL to false to disable. param: string $proxy Proxy URL. param: string $username Proxy username for authentication. param: string $password Proxy password for authentication. |
| _isTooManyRedirects($redirects) X-Ref |
| Test to see if the redirect limit is passed. param: integer $redirects Count so far. return: boolean True if over. |
| setIdentity($host, $realm, $username, $password) X-Ref |
| Sets the identity for the current realm. param: string $host Host to which realm applies. param: string $realm Full name of realm. param: string $username Username for realm. param: string $password Password for realm. |
| fetchResponse($url, $encoding) X-Ref |
| Fetches a URL as a response object. Will keep trying if redirected. It will also collect authentication realm information. param: string/SimpleUrl $url Target to fetch. param: SimpleEncoding $encoding Additional parameters for request. return: SimpleHttpResponse Hopefully the target page. |
| _fetchWhileRedirected($url, $encoding) X-Ref |
| Fetches the page until no longer redirected or until the redirect limit runs out. param: SimpleUrl $url Target to fetch. param: SimpelFormEncoding $encoding Additional parameters for request. return: SimpleHttpResponse Hopefully the target page. |
| _fetch($url, $encoding) X-Ref |
| Actually make the web request. param: SimpleUrl $url Target to fetch. param: SimpleFormEncoding $encoding Additional parameters for request. return: SimpleHttpResponse Headers and hopefully content. |
| _createRequest($url, $encoding) X-Ref |
| Creates a full page request. param: SimpleUrl $url Target to fetch as url object. param: SimpleFormEncoding $encoding POST/GET parameters. return: SimpleHttpRequest New request. |
| _createHttpRequest($url, $encoding) X-Ref |
| Builds the appropriate HTTP request object. param: SimpleUrl $url Target to fetch as url object. param: SimpleFormEncoding $parameters POST/GET parameters. return: SimpleHttpRequest New request object. |
| _createRoute($url) X-Ref |
| Sets up either a direct route or via a proxy. param: SimpleUrl $url Target to fetch as url object. return: SimpleRoute Route to take to fetch URL. |
| _addAdditionalHeaders($request) X-Ref |
| Adds additional manual headers. param: SimpleHttpRequest $request Outgoing request. |
| Généré le : Sun Feb 25 21:07:04 2007 | par Balluche grâce à PHPXref 0.7 |