class CRM_Utils_Cache

Cache is an empty base object, we'll modify the scheme when we have different caching schemes

Properties

static object $_singleton (Quasi-Private) Treat this as private. It is marked public to facilitate testing.

Methods

__construct(array $config)

Constructor.

singleton()

Singleton function used to manage this object.

static array
getCacheSettings($cachePlugin)

Get cache relevant settings.

create(array $params = array())

Create a new, named, limited-use cache.

Details

at line 56
CRM_Utils_Cache __construct(array $config)

Constructor.

Parameters

array $config An array of configuration params.

Return Value

CRM_Utils_Cache

at line 65
static CRM_Utils_Cache_Interface singleton()

Singleton function used to manage this object.

at line 99
static array getCacheSettings($cachePlugin)

Get cache relevant settings.

Parameters

$cachePlugin

Return Value

array associative array of settings for the cache

at line 180
static CRM_Utils_Cache_Interface create(array $params = array())

Create a new, named, limited-use cache.

This is a factory function. Generally, you should use Civi::cache($name) to locate managed cached instance.

Parameters

array $params Array with keys: - name: string, unique symbolic name. - type: array|string, list of acceptable cache types, in order of preference. - prefetch: bool, whether to prefetch all data in cache (if possible).

Return Value

CRM_Utils_Cache_Interface

Exceptions

CRM_Core_Exception

See also

Civi::cache()