class Cache (View source)

This acts as facade for the actual cache implementation and exists primarily for BC reasons.

Properties

static protected CoreHandlerInterface $handler

Methods

static 
getInstance()

No description

getHandler()

Get the cache handler implementation

static 
init()

Initialize the cache. This acts mainly as integration point with legacy caches.

static mixed
load(string $key)

Returns the content of the requested cache entry

static bool
save(mixed $data, string $key, array $tags = [], int|DateInterval|null $lifetime = null, int $priority = 0, bool $force = false)

Save an item to the cache (deferred to shutdown if force is false and forceImmediateWrite is not set)

static bool
remove($key)

Remove an item from the cache

static bool
clearAll()

Empty the cache

static bool
clearTag(string $tag)

Removes entries from the cache matching the given tag

static bool
clearTags(array $tags = [])

Removes entries from the cache matching the given tags

static 
addClearTagOnShutdown(string $tag)

Adds a tag to the shutdown queue

static 
addIgnoredTagOnSave(string $tag)

Add tag to the list ignored on save. Items with this tag won't be saved to cache.

static 
removeIgnoredTagOnSave(string $tag)

Remove tag from the list ignored on save

static 
addIgnoredTagOnClear(string $tag)

Add tag to the list ignored on clear. Tags in this list won't be cleared via clearTags()

static 
removeIgnoredTagOnClear(string $tag)

Remove tag from the list ignored on clear

static 
addClearedTag(string $tag) deprecated

No description

static 
shutdown(bool $forceWrite = false)

Write and clean up cache

static 
disable()

Disables the complete pimcore cache

static 
enable()

Enables the pimcore cache

static bool
isEnabled()

No description

static 
setForceImmediateWrite(bool $forceImmediateWrite)

No description

static bool
getForceImmediateWrite()

No description

static bool
maintenance()

No description

Details

static getInstance()

static CoreHandlerInterface getHandler()

Get the cache handler implementation

Return Value

CoreHandlerInterface

static init()

Initialize the cache. This acts mainly as integration point with legacy caches.

static mixed load(string $key)

Returns the content of the requested cache entry

Parameters

string $key

Return Value

mixed

static bool save(mixed $data, string $key, array $tags = [], int|DateInterval|null $lifetime = null, int $priority = 0, bool $force = false)

Save an item to the cache (deferred to shutdown if force is false and forceImmediateWrite is not set)

Parameters

mixed $data
string $key
array $tags
int|DateInterval|null $lifetime
int $priority
bool $force

Return Value

bool

static bool remove($key)

Remove an item from the cache

Parameters

$key

Return Value

bool

static bool clearAll()

Empty the cache

Return Value

bool

static bool clearTag(string $tag)

Removes entries from the cache matching the given tag

Parameters

string $tag

Return Value

bool

static bool clearTags(array $tags = [])

Removes entries from the cache matching the given tags

Parameters

array $tags

Return Value

bool

static addClearTagOnShutdown(string $tag)

Adds a tag to the shutdown queue

Parameters

string $tag

static addIgnoredTagOnSave(string $tag)

Add tag to the list ignored on save. Items with this tag won't be saved to cache.

Parameters

string $tag

static removeIgnoredTagOnSave(string $tag)

Remove tag from the list ignored on save

Parameters

string $tag

static addIgnoredTagOnClear(string $tag)

Add tag to the list ignored on clear. Tags in this list won't be cleared via clearTags()

Parameters

string $tag

static removeIgnoredTagOnClear(string $tag)

Remove tag from the list ignored on clear

Parameters

string $tag

static addClearedTag(string $tag) deprecated

deprecated Use addIgnoredTagOnSave() instead

Parameters

string $tag

static shutdown(bool $forceWrite = false)

Write and clean up cache

Parameters

bool $forceWrite

static disable()

Disables the complete pimcore cache

static enable()

Enables the pimcore cache

static bool isEnabled()

Return Value

bool

static setForceImmediateWrite(bool $forceImmediateWrite)

Parameters

bool $forceImmediateWrite

static bool getForceImmediateWrite()

Return Value

bool

static bool maintenance()

Return Value

bool