This singleton class provides a convenient caching capbility.
By default this uses the cms_filecache_driver to cache data in the TMP_CACHE_LOCATION for one hour.
package |
CMS |
---|---|
license |
GPL |
get_instance() : \cms_cache_handler
set_driver(\cms_cache_driver &$driver)
get_driver() : \cms_cache_driver
clear(string $group = '') : boolean
If the group is not specified the current set group will be used. If that is empty then all cached values will be cleared. Use with caution.
string
$group boolean
get(string $key, string $group = '') : mixed
string
$keyThe primary key for the cached value
string
$groupAn optional cache group name.
mixed
exists(string $key, string $group = '') : boolean
string
$keyThe primary key for the cached value
string
$groupAn optional cache group name.
boolean
erase(string $key, string $group = '') : boolean
string
$keyThe primary key for the cached value
string
$groupAn optional cache group name.
boolean
set(string $key, mixed $value, string $group = '') : boolean
string
$keyThe primary key for the cached value
mixed
$valuethe value to save
string
$groupAn optional cache group name.
boolean
set_group(string $group) : boolean
This method allows specifying a scope to all cache methods
string
$group boolean
can_cache() : boolean
boolean