thesportsdb-client

Psr16ResponseCache
in package
implements ResponseCache

FinalYes

Caches responses in any PSR-16 cache (Redis, APCu, files...). Needs psr/simple-cache.

Table of Contents

Interfaces

ResponseCache
Stores raw response bodies. Keys never contain an API key.

Properties

$cache  : CacheInterface
$prefix  : string

Methods

__construct()  : mixed
get()  : string|null
put()  : void
key()  : string
PSR-16 keys may not contain {}()/\@: so the request is hashed.

Properties

Methods

__construct()

public __construct(CacheInterface $cache[, string $prefix = 'thesportsdb.' ]) : mixed
Parameters
$cache : CacheInterface
$prefix : string = 'thesportsdb.'

get()

public get(string $key) : string|null
Parameters
$key : string
Return values
string|null

put()

public put(string $key, string $body, float $ttl) : void
Parameters
$key : string
$body : string
$ttl : float

key()

PSR-16 keys may not contain {}()/\@: so the request is hashed.

private key(string $key) : string
Parameters
$key : string
Return values
string
On this page

Search results