class ZendCacheDriver extends AbstractAdapter implements StorageInterface, FlushableInterface (View source)

Class ZendCacheDriver Adapter class to hook Zend's cache into Concrete5's cache.

By passing this class into various Zend classes, it tells Zend use it for storing and retrieving cache values. Values are passed through here and onto Concrete5's caching layer which uses the Stash library. Allows us to use many of the helpful Zend classes without having to maintain a separate cache configuration.

Currently used by:

- Concrete\Core\Feed\FeedService
- Concrete\Core\Localization\Localization

\@package Concrete\Core\Cache\Adapter

Properties

private string $cacheName
protected int $cacheLifetime

Methods

__construct(string $cacheName = 'cache', int $cacheLifetime = null)

No description

mixed
internalGetItem(string $normalizedKey, bool $success = null, mixed $casToken = null)

Internal method to get an item.

bool
internalSetItem(string $normalizedKey, mixed $value)

Internal method to store an item.

bool
internalRemoveItem(string $normalizedKey)

Internal method to remove an item.

bool
flush()

Flush the whole storage.

Details

__construct(string $cacheName = 'cache', int $cacheLifetime = null)

Parameters

string $cacheName Name of the cache being used. Defaults to cache.
int $cacheLifetime Number of seconds to consider the cache fresh before it expires.

protected mixed internalGetItem(string $normalizedKey, bool $success = null, mixed $casToken = null)

Internal method to get an item.

Parameters

string $normalizedKey
bool $success
mixed $casToken

Return Value

mixed Data on success, null on failure

Exceptions

ExceptionInterface

protected bool internalSetItem(string $normalizedKey, mixed $value)

Internal method to store an item.

Parameters

string $normalizedKey
mixed $value

Return Value

bool

Exceptions

ExceptionInterface

protected bool internalRemoveItem(string $normalizedKey)

Internal method to remove an item.

Parameters

string $normalizedKey

Return Value

bool

Exceptions

ExceptionInterface

bool flush()

Flush the whole storage.

Return Value

bool