Service
in package
Wrapper handling boilerplate code around the ARCHE microservice initialization
Requires following config file structure:
dissCacheService:
db: sqlite:/some/path
log:
file: /some/path
level: debug
ttl:
resource: 3600
response: 31536000
repoDb:
- repoConfigPath.yaml
allowedNmsp:
- https://one
- https://another
metadataMode: parents
parentProperty: ""
resourceProperties: []
relativesProperties: []
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- getClearCache() : bool
- Provides a standardized way to determine if the cache should be invalidated
- getConfig() : object
- getLog() : Log
- processException() : ResponseCacheItem
- serveRequest() : ResponseCacheItem
- setCallback() : void
- setCacheControlHeader() : void
Properties
$cacheDb
private
CachePdo
$cacheDb
$clbck
private
callable
$clbck
$config
private
object
$config
$log
private
Log
$log
Methods
__construct()
public
__construct(string $confFile) : mixed
Parameters
- $confFile : string
getClearCache()
Provides a standardized way to determine if the cache should be invalidated
public
static getClearCache([bool $httpCacheControl = true ][, string $noCacheQueryParam = 'noCache' ]) : bool
Parameters
- $httpCacheControl : bool = true
- $noCacheQueryParam : string = 'noCache'
Return values
boolgetConfig()
public
getConfig() : object
Return values
objectgetLog()
public
getLog() : Log
Return values
LogprocessException()
public
processException(Throwable $e) : ResponseCacheItem
Parameters
- $e : Throwable
Return values
ResponseCacheItemserveRequest()
public
serveRequest(string $id, array<string|int, mixed> $param[, bool|null $clearCache = null ]) : ResponseCacheItem
Parameters
- $id : string
- $param : array<string|int, mixed>
- $clearCache : bool|null = null
Return values
ResponseCacheItemsetCallback()
public
setCallback(callable $clbck) : void
Parameters
- $clbck : callable
-
response cache miss handler with signature
fn(acdhOeaw\arche\lib\RepoResourceInterface $res, array $param)where the$paramwill passed from theserveRequest()method$paramparameter.
setCacheControlHeader()
private
setCacheControlHeader(ResponseCacheItem $response) : void
Parameters
- $response : ResponseCacheItem