Open Journal Systems  3.3.0
Guzzle\Plugin\Cache\DefaultCacheStorage Class Reference
Inheritance diagram for Guzzle\Plugin\Cache\DefaultCacheStorage:
Guzzle\Plugin\Cache\CacheStorageInterface

Public Member Functions

 __construct ($cache, $keyPrefix='', $defaultTtl=3600)
 
 cache (RequestInterface $request, Response $response)
 
 delete (RequestInterface $request)
 
 fetch (RequestInterface $request)
 
 purge ($url)
 

Protected Member Functions

 getBodyKey ($url, EntityBodyInterface $body)
 
 getCacheKey (RequestInterface $request)
 

Protected Attributes

 $cache
 
 $defaultTtl
 
 $keyPrefix
 

Detailed Description

Default cache storage implementation

Definition at line 16 of file DefaultCacheStorage.php.

Constructor & Destructor Documentation

◆ __construct()

Guzzle\Plugin\Cache\DefaultCacheStorage::__construct (   $cache,
  $keyPrefix = '',
  $defaultTtl = 3600 
)
Parameters
mixed$cacheCache used to store cache data
string$keyPrefixProvide an optional key prefix to prefix on all cache keys
int$defaultTtlDefault cache TTL

Definition at line 41 of file DefaultCacheStorage.php.

References Guzzle\Plugin\Cache\DefaultCacheStorage\$cache, Guzzle\Plugin\Cache\DefaultCacheStorage\$defaultTtl, Guzzle\Plugin\Cache\DefaultCacheStorage\$keyPrefix, Guzzle\Plugin\Cache\DefaultCacheStorage\cache(), and Guzzle\Cache\CacheAdapterFactory\fromCache().

Member Function Documentation

◆ cache()

◆ delete()

Guzzle\Plugin\Cache\DefaultCacheStorage::delete ( RequestInterface  $request)

Deletes cache entries that match a request

Parameters
RequestInterface$requestRequest to delete from cache

Implements Guzzle\Plugin\Cache\CacheStorageInterface.

Definition at line 111 of file DefaultCacheStorage.php.

References Guzzle\Plugin\Cache\DefaultCacheStorage\cache(), and Guzzle\Plugin\Cache\DefaultCacheStorage\getCacheKey().

◆ fetch()

Guzzle\Plugin\Cache\DefaultCacheStorage::fetch ( RequestInterface  $request)

Get a Response from the cache for a request

Parameters
RequestInterface$request
Returns
null|Response

Implements Guzzle\Plugin\Cache\CacheStorageInterface.

Definition at line 132 of file DefaultCacheStorage.php.

References Guzzle\Plugin\Cache\DefaultCacheStorage\cache(), and Guzzle\Plugin\Cache\DefaultCacheStorage\getCacheKey().

◆ getBodyKey()

Guzzle\Plugin\Cache\DefaultCacheStorage::getBodyKey (   $url,
EntityBodyInterface  $body 
)
protected

Create a cache key for a response's body

Parameters
string$urlURL of the entry
EntityBodyInterface$bodyResponse body
Returns
string

Definition at line 213 of file DefaultCacheStorage.php.

References Guzzle\Http\EntityBodyInterface\getContentMd5().

Referenced by Guzzle\Plugin\Cache\DefaultCacheStorage\cache().

◆ getCacheKey()

Guzzle\Plugin\Cache\DefaultCacheStorage::getCacheKey ( RequestInterface  $request)
protected

◆ purge()

Guzzle\Plugin\Cache\DefaultCacheStorage::purge (   $url)

Purge all cache entries for a given URL

Parameters
string$url

Implements Guzzle\Plugin\Cache\CacheStorageInterface.

Definition at line 125 of file DefaultCacheStorage.php.

Field Documentation

◆ $cache

CacheAdapterInterface Guzzle\Plugin\Cache\DefaultCacheStorage::$cache
protected

Cache used to store cache data

Definition at line 28 of file DefaultCacheStorage.php.

Referenced by Guzzle\Plugin\Cache\DefaultCacheStorage\__construct().

◆ $defaultTtl

int Guzzle\Plugin\Cache\DefaultCacheStorage::$defaultTtl
protected

◆ $keyPrefix

string Guzzle\Plugin\Cache\DefaultCacheStorage::$keyPrefix
protected

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