Open Journal Systems  3.3.0
Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar Class Reference
Inheritance diagram for Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar:
Guzzle\Plugin\Cookie\CookieJar\CookieJarInterface Guzzle\Plugin\Cookie\CookieJar\FileCookieJar

Public Member Functions

 __construct ($strictMode=false)
 
 add (Cookie $cookie)
 
 addCookiesFromResponse (Response $response, RequestInterface $request=null)
 
 all ($domain=null, $path=null, $name=null, $skipDiscardable=false, $skipExpired=true)
 
 count ()
 
 getIterator ()
 
 getMatchingCookies (RequestInterface $request)
 
 remove ($domain=null, $path=null, $name=null)
 
 removeExpired ()
 
 removeTemporary ()
 
 serialize ()
 
 setStrictMode ($strictMode)
 
 unserialize ($data)
 

Protected Attributes

 $cookies = array()
 
 $strictMode
 

Detailed Description

Cookie cookieJar that stores cookies an an array

Definition at line 14 of file ArrayCookieJar.php.

Constructor & Destructor Documentation

◆ __construct()

Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar::__construct (   $strictMode = false)
Parameters
bool$strictModeSet to true to throw exceptions when invalid cookies are added to the cookie jar

Reimplemented in Guzzle\Plugin\Cookie\CookieJar\FileCookieJar.

Definition at line 31 of file ArrayCookieJar.php.

References Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar\$strictMode.

Member Function Documentation

◆ add()

◆ addCookiesFromResponse()

Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar::addCookiesFromResponse ( Response  $response,
RequestInterface  $request = null 
)

Add cookies from a {

See also
Guzzle\Http\Message\Response} object
Parameters
Response$responseResponse object
RequestInterface$requestRequest that received the response

Implements Guzzle\Plugin\Cookie\CookieJar\CookieJarInterface.

Definition at line 194 of file ArrayCookieJar.php.

References Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar\add(), and Guzzle\Parser\ParserRegistry\getInstance().

◆ all()

Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar::all (   $domain = null,
  $path = null,
  $name = null,
  $skipDiscardable = false,
  $skipExpired = true 
)

Get all of the matching cookies

Parameters
string$domainDomain of the cookie
string$pathPath of the cookie
string$nameName of the cookie
bool$skipDiscardableSet to TRUE to skip cookies with the Discard attribute.
bool$skipExpiredSet to FALSE to include expired
Returns
array Returns an array of Cookie objects

Implements Guzzle\Plugin\Cookie\CookieJar\CookieJarInterface.

Definition at line 77 of file ArrayCookieJar.php.

References Guzzle\Plugin\Cookie\Cookie\getDiscard(), Guzzle\Plugin\Cookie\Cookie\getExpires(), Guzzle\Plugin\Cookie\Cookie\getName(), Guzzle\Plugin\Cookie\Cookie\isExpired(), Guzzle\Plugin\Cookie\Cookie\matchesDomain(), and Guzzle\Plugin\Cookie\Cookie\matchesPath().

Referenced by Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar\getMatchingCookies(), Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar\remove(), and Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar\serialize().

◆ count()

Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar::count ( )

Returns the total number of stored cookies

Returns
int

Definition at line 179 of file ArrayCookieJar.php.

◆ getIterator()

Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar::getIterator ( )

Returns an iterator

Returns
\ArrayIterator

Definition at line 189 of file ArrayCookieJar.php.

◆ getMatchingCookies()

◆ remove()

Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar::remove (   $domain = null,
  $path = null,
  $name = null 
)

Remove cookies currently held in the Cookie cookieJar.

Invoking this method without arguments will empty the whole Cookie cookieJar. If given a $domain argument only cookies belonging to that domain will be removed. If given a $domain and $path argument, cookies belonging to the specified path within that domain are removed. If given all three arguments, then the cookie with the specified name, path and domain is removed.

Parameters
string$domainSet to clear only cookies matching a domain
string$pathSet to clear only cookies matching a domain and path
string$nameSet to clear only cookies matching a domain, path, and name
Returns
CookieJarInterface

Implements Guzzle\Plugin\Cookie\CookieJar\CookieJarInterface.

Definition at line 48 of file ArrayCookieJar.php.

References Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar\$cookies, and Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar\all().

◆ removeExpired()

Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar::removeExpired ( )

Delete any expired cookies

Returns
CookieJarInterface

Implements Guzzle\Plugin\Cookie\CookieJar\CookieJarInterface.

Definition at line 67 of file ArrayCookieJar.php.

References Guzzle\Plugin\Cookie\Cookie\getExpires().

◆ removeTemporary()

Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar::removeTemporary ( )

Discard all temporary cookies.

Scans for all cookies in the cookieJar with either no expire field or a true discard flag. To be called when the user agent shuts down according to RFC 2965.

Returns
CookieJarInterface

Implements Guzzle\Plugin\Cookie\CookieJar\CookieJarInterface.

Definition at line 58 of file ArrayCookieJar.php.

References Guzzle\Plugin\Cookie\Cookie\getDiscard(), and Guzzle\Plugin\Cookie\Cookie\getExpires().

◆ serialize()

Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar::serialize ( )

Serializes the cookie cookieJar

Returns
string

Definition at line 151 of file ArrayCookieJar.php.

References Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar\all(), and Guzzle\Plugin\Cookie\Cookie\toArray().

Referenced by Guzzle\Plugin\Cookie\CookieJar\FileCookieJar\persist().

◆ setStrictMode()

Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar::setStrictMode (   $strictMode)

Enable or disable strict mode on the cookie jar

Parameters
bool$strictModeSet to true to throw exceptions when invalid cookies are added. False to ignore them.
Returns
self

Definition at line 43 of file ArrayCookieJar.php.

References Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar\$strictMode.

◆ unserialize()

Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar::unserialize (   $data)

Unserializes the cookie cookieJar

Definition at line 162 of file ArrayCookieJar.php.

Referenced by Guzzle\Plugin\Cookie\CookieJar\FileCookieJar\load().

Field Documentation

◆ $cookies

array Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar::$cookies = array()
protected

◆ $strictMode

bool Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar::$strictMode
protected

Whether or not strict mode is enabled. When enabled, exceptions will be thrown for invalid cookies

Definition at line 26 of file ArrayCookieJar.php.

Referenced by Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar\__construct(), and Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar\setStrictMode().


The documentation for this class was generated from the following file: