# \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

File
  lib/class.cms_filecache_driver.php
Package
  \CGExtensions
Class hierarchy
  \cms_cache_driver
  \cms_filecache_driver

## Tags

todo |

## Constants

### LOCK_READ

    LOCK_READ

#

## Tags

todo |

### LOCK_WRITE

    LOCK_WRITE

#

## Tags

todo |

### LOCK_UNLOCK

    LOCK_UNLOCK

#

## Tags

todo |

### KEY_SERIALIZED

    KEY_SERIALIZED

#

## Tags

todo |

## Methods

### __construct()

    __construct(array $opts)

The constructor

#### Parameters

array | $opts | Optional parameters.

#

## Tags

todo |

### get()

    get(string $key, string $group)

Retrieve a cached value.

#### Parameters

string | $key | The variable key.
string | $group | The cache group

#

abstract

Inherited from
  \cms_cache_driver

## Tags

todo |

### clear()

    clear(string $group)

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

#### Parameters

string | $group | The cache group

#

abstract

Inherited from
  \cms_cache_driver

## Tags

todo |

### 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

#

abstract

Inherited from
  \cms_cache_driver

## Tags

todo |

### erase()

    erase(string $key, string $group)

Erase a cached value.

#### Parameters

string | $key | The variable key.
string | $group | The cache group

#

abstract

Inherited from
  \cms_cache_driver

## Tags

todo |

### 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

#

abstract

Inherited from
  \cms_cache_driver

## Tags

todo |

### 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.

#

## Tags

todo |

### class.cms_filecache_driver.php