ResponseCache
in package
Description of Cache
Tags
Table of Contents
Constants
- HASH_ALGO = 'xxh128'
Properties
- $cache : CacheInterface
- $lastResponseKey : string
- $log : LoggerInterface|null
- $missHandler : callable
- $repos : array<string|int, RepoWrapperInterface>
- $searchCfg : SearchConfig
- $ttlResource : int
- $ttlResponse : int
Methods
- __construct() : mixed
- getLastResponseKey() : string|false
- getResponse() : ResponseCacheItem
- hashParams() : string
- Public only to simplify the testing.
- pruneCacheForResource() : void
Constants
HASH_ALGO
public
mixed
HASH_ALGO
= 'xxh128'
Properties
$cache
private
CacheInterface
$cache
$lastResponseKey
private
string
$lastResponseKey
$log
private
LoggerInterface|null
$log
$missHandler
private
callable
$missHandler
$repos
private
array<string|int, RepoWrapperInterface>
$repos
$searchCfg
private
SearchConfig
$searchCfg
$ttlResource
private
int
$ttlResource
$ttlResponse
private
int
$ttlResponse
Methods
__construct()
public
__construct(CacheInterface $cache, callable $missHandler, int $ttlResource, int $ttlResponse, array<string|int, RepoWrapperInterface> $repos[, SearchConfig|null $config = null ][, LoggerInterface|null $log = null ]) : mixed
Parameters
- $cache : CacheInterface
- $missHandler : callable
-
with the signature
function(RepoResourceInterface $res): ResponseCacheItem
- $ttlResource : int
- $ttlResponse : int
- $repos : array<string|int, RepoWrapperInterface>
- $config : SearchConfig|null = null
- $log : LoggerInterface|null = null
getLastResponseKey()
public
getLastResponseKey() : string|false
Return values
string|falsegetResponse()
public
getResponse(string|object|array<string|int, mixed> $params, string $resId) : ResponseCacheItem
Parameters
- $params : string|object|array<string|int, mixed>
- $resId : string
Return values
ResponseCacheItemhashParams()
Public only to simplify the testing.
public
hashParams(string|object|array<string|int, mixed> $key, string $resId) : string
Parameters
- $key : string|object|array<string|int, mixed>
- $resId : string
Return values
stringpruneCacheForResource()
public
pruneCacheForResource(string $resId) : void
Parameters
- $resId : string