|
Moodle
2.2.1
http://www.collinsharper.com
|
Public Member Functions | |
| __construct () | |
| addCookie ($cookie, $ref_uri=null) | |
| addCookiesFromResponse ($response, $ref_uri) | |
| getAllCookies ($ret_as=self::COOKIE_OBJECT) | |
| getMatchingCookies ($uri, $matchSessionCookies=true, $ret_as=self::COOKIE_OBJECT, $now=null) | |
| getCookie ($uri, $cookie_name, $ret_as=self::COOKIE_OBJECT) | |
| count () | |
| getIterator () | |
| isEmpty () | |
| reset () | |
Static Public Member Functions | |
| static | fromResponse (Zend_Http_Response $response, $ref_uri) |
Data Fields | |
| const | COOKIE_OBJECT = 0 |
| const | COOKIE_STRING_ARRAY = 1 |
| const | COOKIE_STRING_CONCAT = 2 |
Protected Member Functions | |
| _flattenCookiesArray ($ptr, $ret_as=self::COOKIE_OBJECT) | |
| _matchDomain ($domain) | |
| _matchPath ($domains, $path) | |
Protected Attributes | |
| $cookies = array() | |
| $_rawCookies = array() | |
Definition at line 60 of file CookieJar.php.
| __construct | ( | ) |
Construct a new CookieJar object
Definition at line 110 of file CookieJar.php.
| _flattenCookiesArray | ( | $ | ptr, |
| $ | ret_as = self::COOKIE_OBJECT |
||
| ) | [protected] |
Helper function to recursivly flatten an array. Shoud be used when exporting the cookies array (or parts of it)
| Zend_Http_Cookie | array | $ptr | |
| int | $ret_as | What value to return |
Definition at line 269 of file CookieJar.php.

| _matchDomain | ( | $ | domain | ) | [protected] |
Return a subset of the cookies array matching a specific domain
| string | $domain |
Definition at line 306 of file CookieJar.php.


| _matchPath | ( | $ | domains, |
| $ | path | ||
| ) | [protected] |
Return a subset of a domain-matching cookies that also match a specified path
| array | $dom_array | |
| string | $path |
Definition at line 326 of file CookieJar.php.


| addCookie | ( | $ | cookie, |
| $ | ref_uri = null |
||
| ) |
Add a cookie to the jar. Cookie should be passed either as a Zend_Http_Cookie object or as a string - in which case an object is created from the string.
| Zend_Http_Cookie | string | $cookie | |
| Zend_Uri_Http | string | $ref_uri | Optional reference URI (for domain, path, secure) |
Definition at line 120 of file CookieJar.php.


| addCookiesFromResponse | ( | $ | response, |
| $ | ref_uri | ||
| ) |
Parse an HTTP response, adding all the cookies set in that response to the cookie jar.
| Zend_Http_Response | $response | |
| Zend_Uri_Http | string | $ref_uri | Requested URI |
Definition at line 146 of file CookieJar.php.

| count | ( | ) |
Required by Countable interface
Definition at line 368 of file CookieJar.php.

| static fromResponse | ( | Zend_Http_Response $ | response, |
| $ | ref_uri | ||
| ) | [static] |
Create a new CookieJar object and automatically load into it all the cookies set in an Http_Response object. If $uri is set, it will be considered as the requested URI for setting default domain and path of the cookie.
| Zend_Http_Response | $response | HTTP Response object |
| Zend_Uri_Http | string | $uri | The requested URI |
Definition at line 356 of file CookieJar.php.
| getAllCookies | ( | $ | ret_as = self::COOKIE_OBJECT | ) |
Get all cookies in the cookie jar as an array
| int | $ret_as | Whether to return cookies as objects of Zend_Http_Cookie or as strings |
Definition at line 171 of file CookieJar.php.

| getCookie | ( | $ | uri, |
| $ | cookie_name, | ||
| $ | ret_as = self::COOKIE_OBJECT |
||
| ) |
Get a specific cookie according to a URI and name
| Zend_Uri_Http | string | $uri | The uri (domain and path) to match |
| string | $cookie_name | The cookie's name |
| int | $ret_as | Whether to return cookies as objects of Zend_Http_Cookie or as strings |
Definition at line 222 of file CookieJar.php.

| getIterator | ( | ) |
Required by IteratorAggregate interface
Definition at line 378 of file CookieJar.php.
| getMatchingCookies | ( | $ | uri, |
| $ | matchSessionCookies = true, |
||
| $ | ret_as = self::COOKIE_OBJECT, |
||
| $ | now = null |
||
| ) |
Return an array of all cookies matching a specific request according to the request URI, whether session cookies should be sent or not, and the time to consider as "now" when checking cookie expiry time.
| string | Zend_Uri_Http | $uri | URI to check against (secure, domain, path) |
| boolean | $matchSessionCookies | Whether to send session cookies |
| int | $ret_as | Whether to return cookies as objects of Zend_Http_Cookie or as strings |
| int | $now | Override the current time when checking for expiry time |
Definition at line 188 of file CookieJar.php.

| isEmpty | ( | ) |
Tells if the jar is empty of any cookie
Definition at line 388 of file CookieJar.php.

| reset | ( | ) |
Empties the cookieJar of any cookie
Definition at line 398 of file CookieJar.php.
$_rawCookies = array() [protected] |
Definition at line 104 of file CookieJar.php.
$cookies = array() [protected] |
Definition at line 97 of file CookieJar.php.
| const COOKIE_OBJECT = 0 |
Return cookie(s) as a Zend_Http_Cookie object
Definition at line 66 of file CookieJar.php.
| const COOKIE_STRING_ARRAY = 1 |
Return cookie(s) as a string (suitable for sending in an HTTP request)
Definition at line 72 of file CookieJar.php.
| const COOKIE_STRING_CONCAT = 2 |
Return all cookies as one long string (suitable for sending in an HTTP request)
Definition at line 78 of file CookieJar.php.