Cache
in package
Wrapper around caching engines
Table of Contents
Constants
- TIMEOUT = 3600
Properties
Methods
- __construct() : mixed
- exists() : bool
- Checks if `key` exists
- get() : object|null
- Get cached item or null if it doesn't exist
- handleFeed() : Feed
- Gets feed from cache key
- handleInfo() : Info
- Gets info from cache key
- set() : void
- Writes data to cache
Constants
TIMEOUT
public
mixed
TIMEOUT
= 3600
Properties
$enabled
private
bool
$enabled
= false
$engine
private
ICache
$engine
Methods
__construct()
public
__construct([ICache|null $cache_engine = null ]) : mixed
Parameters
- $cache_engine : ICache|null = null
exists()
Checks if `key` exists
public
exists(string $key) : bool
Parameters
- $key : string
-
Cache key
Return values
boolget()
Get cached item or null if it doesn't exist
public
get(string $key) : object|null
Parameters
- $key : string
-
Cache key
Return values
object|null —Cache value
handleFeed()
Gets feed from cache key
public
handleFeed(string $key) : Feed
Parameters
- $key : string
-
Cache key
Return values
Feed —Feed data
handleInfo()
Gets info from cache key
public
handleInfo(string $key) : Info
Parameters
- $key : string
-
Cache key
Return values
Info —Info data
set()
Writes data to cache
public
set(string $key, string $data) : void
Parameters
- $key : string
-
Cache key
- $data : string
-
Unserialized data