Open Journal Systems
3.3.0
|
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 | |
Default cache storage implementation
Definition at line 16 of file DefaultCacheStorage.php.
Guzzle\Plugin\Cache\DefaultCacheStorage::__construct | ( | $cache, | |
$keyPrefix = '' , |
|||
$defaultTtl = 3600 |
|||
) |
mixed | $cache | Cache used to store cache data |
string | $keyPrefix | Provide an optional key prefix to prefix on all cache keys |
int | $defaultTtl | Default 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().
Guzzle\Plugin\Cache\DefaultCacheStorage::cache | ( | RequestInterface | $request, |
Response | $response | ||
) |
Cache an HTTP request
RequestInterface | $request | Request being cached |
Response | $response | Response to cache |
Implements Guzzle\Plugin\Cache\CacheStorageInterface.
Definition at line 48 of file DefaultCacheStorage.php.
References Guzzle\Plugin\Cache\DefaultCacheStorage\$defaultTtl, Guzzle\Plugin\Cache\DefaultCacheStorage\getBodyKey(), Guzzle\Plugin\Cache\DefaultCacheStorage\getCacheKey(), Guzzle\Http\Message\MessageInterface\getParams(), and Guzzle\Http\Message\RequestInterface\getUrl().
Referenced by Guzzle\Plugin\Cache\DefaultCacheStorage\__construct(), Guzzle\Plugin\Cache\DefaultCacheStorage\delete(), and Guzzle\Plugin\Cache\DefaultCacheStorage\fetch().
Guzzle\Plugin\Cache\DefaultCacheStorage::delete | ( | RequestInterface | $request | ) |
Deletes cache entries that match a request
RequestInterface | $request | Request 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().
Guzzle\Plugin\Cache\DefaultCacheStorage::fetch | ( | RequestInterface | $request | ) |
Get a Response from the cache for a request
RequestInterface | $request |
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().
|
protected |
Create a cache key for a response's body
string | $url | URL of the entry |
EntityBodyInterface | $body | Response body |
Definition at line 213 of file DefaultCacheStorage.php.
References Guzzle\Http\EntityBodyInterface\getContentMd5().
Referenced by Guzzle\Plugin\Cache\DefaultCacheStorage\cache().
|
protected |
Hash a request URL into a string that returns cache metadata
RequestInterface | $request |
Definition at line 190 of file DefaultCacheStorage.php.
References Guzzle\Http\Message\RequestInterface\getMethod(), Guzzle\Http\Message\MessageInterface\getParams(), and Guzzle\Http\Message\RequestInterface\getUrl().
Referenced by Guzzle\Plugin\Cache\DefaultCacheStorage\cache(), Guzzle\Plugin\Cache\DefaultCacheStorage\delete(), and Guzzle\Plugin\Cache\DefaultCacheStorage\fetch().
Guzzle\Plugin\Cache\DefaultCacheStorage::purge | ( | $url | ) |
Purge all cache entries for a given URL
string | $url |
Implements Guzzle\Plugin\Cache\CacheStorageInterface.
Definition at line 125 of file DefaultCacheStorage.php.
|
protected |
Cache used to store cache data
Definition at line 28 of file DefaultCacheStorage.php.
Referenced by Guzzle\Plugin\Cache\DefaultCacheStorage\__construct().
|
protected |
Default cache TTL
Definition at line 34 of file DefaultCacheStorage.php.
Referenced by Guzzle\Plugin\Cache\DefaultCacheStorage\__construct(), and Guzzle\Plugin\Cache\DefaultCacheStorage\cache().
|
protected |
Definition at line 22 of file DefaultCacheStorage.php.
Referenced by Guzzle\Plugin\Cache\DefaultCacheStorage\__construct().