\cge_smartcache_handler

A class to aide in caching data in a key value mechanism.

By default this class uses the cms_filecache_driver as a driver. However, any class that extends cms_cache_driver will work.

Summary

Methods
Properties
Constants
__construct()
set_group()
clear()
get()
exists()
erase()
set()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

__construct()

__construct(array $opts)

Constructor.

Parameters

array $opts

Array of options. Possible options are: cache_dir - The absolute directory of the cache location (passed to the driver) driver - The name of the driver class to use (cms_filecache_driver is the default) group - The name of a group (sort of namespace) to subset keys into lifetime - The lifetime of the cached values (in seconds) autoclean - Whether the cache driver should automatically clean up expired values locking - Whether the cache driver should employ locking (if possible)

set_group()

set_group(string $group)

Set the group (namespace) to store variables in.

Parameters

string $group

clear()

clear(string $group) : bool

Clear all cached data.

Parameters

string $group

An optional group name. If not specified, the current group is used.

Returns

bool

get()

get(string $key, string $group) : mixed

Get the specified cached data value

Parameters

string $key

The key

string $group

An optional group. If not specified, the current group value is used.

Returns

mixed

exists()

exists(string $key, string $group) : bool

Test if the specified data value exists within the cache.

Parameters

string $key

The key

string $group

An optional group. If not specified, the current group value is used.

Returns

bool

erase()

erase(string $key, string $group)

Erase the specified data value from the cache.

Parameters

string $key

The key

string $group

An optional group. If not specified, the current group value is used.

set()

set(string $key, mixed $value, string $group)

Store data into the cache

Parameters

string $key
mixed $value
string $group

An optional group. If not specified, the current group value is used.