\cms_cache_handler

This class provides static methods for setting up an app wide cache handler.

to allow caching data for a limited amount of time.

Summary

Methods
Properties
Constants
get_instance()
set_driver()
get_driver()
clear()
get()
exists()
erase()
set()
can_cache()
No public properties found
TYPE_ANY
TYPE_PAGE
TYPE_CONTENT
TYPE_MODULE
TYPE_TEMPLATE
TYPE_STYLESHEET
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Constants

TYPE_ANY

TYPE_ANY

TYPE_PAGE

TYPE_PAGE

TYPE_CONTENT

TYPE_CONTENT

TYPE_MODULE

TYPE_MODULE

TYPE_TEMPLATE

TYPE_TEMPLATE

TYPE_STYLESHEET

TYPE_STYLESHEET

Methods

get_instance()

get_instance()

Get the global instance of the cms_cache_handler object

set_driver()

set_driver(\cms_cache_driver $driver)

Set the cache driver into this object.

Parameters

\cms_cache_driver $driver

get_driver()

get_driver() : \cms_cache_driver

Return the cache driver for this object

Returns

\cms_cache_driver

clear()

clear(string $group)

A wrapper to clear the cache (for a specified cache group) independent of the driver.

the cache driver may have a default group.

Parameters

string $group

get()

get(string $key, string $group)

A wrapper to retrieve a cached driver independent of the driver.

the cache driver may have a default group.

Parameters

string $key

the cache key.

string $group

exists()

exists(string $key, string $group)

A wrapper method to test if an item exists in the cache. Independent of the driver.

the cache driver may have a default group.

Parameters

string $key

the cache key.

string $group

erase()

erase(string $key, string $group)

A wrapper method to remove an item from the cache. Independent of the driver.

the cache driver may have a default group.

Parameters

string $key

the cache key.

string $group

set()

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

A wrapper method to store data into the cache. Independent of the driver.

the cache driver may have a default group.

Parameters

string $key

the cache key.

string $value

The data to store.

string $group

can_cache()

can_cache() : bool

This method tests if an item can be stored in the cache for a request.

This is because at certain times (i.e: during module installation, or in a stylesheet request) it may be inappropriate or unable to store data as the cache would be invalidated by a higher level function.

Returns

bool