Documentation

ResponseCache
in package
implements CallbackContextInterface

Description of Cache

Tags
author

zozlak

Table of Contents

Interfaces

CallbackContextInterface

Constants

HARD_TTL_MULTIPLIER  = 10
HASH_ALGO  = 'xxh128'

Properties

$authConfig  : AuthConfig|null
$cache  : CacheInterface
$fileCache  : FileCache|null
$hardTtlResource  : int
$lastResponseKey  : string
$log  : LoggerInterface|null
$missHandler  : callable
$noCache  : bool
$repos  : array<string|int, RepoWrapperInterface>
$searchCfg  : SearchConfig
$ttlResource  : int
$ttlResponse  : int

Methods

__construct()  : mixed
getClientRoles()  : array<string|int, string>
getFileCache()  : FileCache
getLastResponseKey()  : string|false
getLog()  : LoggerInterface|null
getNoCache()  : bool
getResponse()  : ResponseCacheItem
hashParams()  : string
Public only to simplify the testing.
pruneCacheForResource()  : void
checkAuth()  : void

Constants

Properties

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 ][, int|null $hardTtlResource = null ][, AuthConfig|null $authConfig = null ][, FileCache|null $fileCache = 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
$hardTtlResource : int|null = null
$authConfig : AuthConfig|null = null
$fileCache : FileCache|null = null

getClientRoles()

public getClientRoles(string $repoBaseUrl) : array<string|int, string>
Parameters
$repoBaseUrl : string
Return values
array<string|int, string>

getLastResponseKey()

public getLastResponseKey() : string|false
Return values
string|false

getLog()

public getLog() : LoggerInterface|null
Return values
LoggerInterface|null

getResponse()

public getResponse(string|object|array<string|int, mixed> $params, string $resId[, bool $noCache = false ]) : ResponseCacheItem
Parameters
$params : string|object|array<string|int, mixed>
$resId : string
$noCache : bool = false
Return values
ResponseCacheItem

hashParams()

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
string

pruneCacheForResource()

public pruneCacheForResource(string $resId) : void
Parameters
$resId : string

        
On this page

Search results