cms_filecache_driver View code

Extends \cms_cache_driver

A cache driver to cache files using the filesystem.

This driver stores files in the CMSMS TMP_CACHE location. Supports read, and write locking a settable cache lifetime, md5 encoded keys and groups so that filenames cannot be easily determined, and automatic cleaning.

package

CMS

license

GPL

since 2.0
author

Robert Campbell

Methods

__construct(string $opts) 

Constructor

Accepts an associative array of options as follows: lifetime => seconds (default 3600) locking => boolean (default false) cache_dir => string (default TMP_CACHE_LOCATION) auto_cleaning => boolean (default false) blocking => boolean (default false) grouop => string (no default)

Arguments

string $opts

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

Retrieve a cached value If the $group parameter is not specified, use the current group

inherited abstract

Arguments

string $key

string $group

Response

mixed

clear(string $group = '') 

Clear all cached values in a group.

inherited abstract

If the $group parameter is not specified, use the current group

Arguments

string $group

exists(string $key, string $group = '') : boolean

Test if a cached value exists If the $group parameter is not specified, use the current group

inherited abstract

Arguments

string $key

string $group

Response

boolean

erase(string $key, string $group = '') 

Erase a cached value.

inherited abstract

If the $group parameter is not specified, use the current group

Arguments

string $key

string $group

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

Add a cached value If the $group parameter is not specified, use the current group

inherited abstract

Arguments

string $key

mixed $value

string $group

set_group(string $group) 

Set A current group

inherited abstract

Arguments

string $group