CacheStorage
class CacheStorage
Abstract cache storage handler
Properties
Methods
__construct(
array $options = array())
Constructor
static
CacheStorage
getInstance(
string $handler = null,
array $options = array())
Returns a cache storage handler object.
boolean
contains(
string $id,
string $group)
Check if the cache contains data stored by ID and group
mixed
get(
string $id,
string $group,
boolean $checkTime = true)
Get cached data by ID and group
mixed
getAll()
Get all cached data
boolean
store(
string $id,
string $group,
string $data)
Store the data to cache by ID and group
boolean
remove(
string $id,
string $group)
Remove a cached data entry by ID and group
boolean
clean(
string $group,
string $mode = null)
Clean cache for a group given a mode.
boolean
flush()
Flush all existing items in storage.
boolean
gc()
Garbage collect expired cache data
static
boolean
isSupported()
Test to see if the storage handler is available.
static
boolean
test()
Test to see if the storage handler is available.
mixed
lock(
string $id,
string $group,
integer $locktime)
Lock cached item
boolean
unlock(
string $id,
string $group = null)
Unlock cached item
static
array
addIncludePath(
array|string $path = '')
Add a directory where CacheStorage should search for handlers. You may either pass a string or an array of directories.
Details
static
CacheStorage
getInstance(
string $handler = null,
array $options = array())
Returns a cache storage handler object.
boolean
contains(
string $id,
string $group)
Check if the cache contains data stored by ID and group