\cms_filecache_driver

A cache driver that stores cached data in the CMSMS tmp/cache directory.

This class supports file locking, and serializing advanced data. It supports storing files in munged filenames (so that the content of files is difficult to discern by the filename, locking blocking, and grouping cached data.

parameters: lifetime int (cache lifetime in seconds) (default of 300 seconds) locking bool (enable locking) (off by default) cache_dir string (Cache directory. default is /tmp auto_cleanup bool (automatically clean expired caches) default is 0 blocking bool auto enable blocking (default is off) group string Default cache group name.

$driver = new cms_filecache_driver(array('cache_dir'=>TMP_CACHE_LOCATION,'group'=>'webpages'));

Summary

Methods
Properties
Constants
__construct()
get()
clear()
exists()
erase()
set()
touch()
No public properties found
LOCK_READ
LOCK_WRITE
LOCK_UNLOCK
KEY_SERIALIZED
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Constants

LOCK_READ

LOCK_READ

LOCK_WRITE

LOCK_WRITE

LOCK_UNLOCK

LOCK_UNLOCK

KEY_SERIALIZED

KEY_SERIALIZED

Methods

__construct()

__construct(array $opts)

The constructor

Parameters

array $opts

Optional parameters.

get()

get(string $key, string $group)

Retrieve a cached value.

Parameters

string $key

The variable key.

string $group

The cache group

clear()

clear(string $group)

Clear a cache group (or the default cache group).

Parameters

string $group

The cache group

exists()

exists(string $key, string $group)

Test if a value exists in the cache

Parameters

string $key

The variable key.

string $group

The cache group

erase()

erase(string $key, string $group)

Erase a cached value.

Parameters

string $key

The variable key.

string $group

The cache group

set()

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

Store a value into the cache.

Parameters

string $key

The variable key.

string $value

The data to store.

string $group

The cache group

touch()

touch(string $key, string $group)

Touch data in the cache to prevent expiry

Parameters

string $key

the data key.

string $group

An optional group name (of not specified the default group stored in the object is used.