CacheManager

class \TYPO3\CMS\Core\Cache\CacheManager

Implements
SingletonInterface

Table of Contents

Interfaces

SingletonInterface
"empty" interface for singletons (marker interface pattern)

Properties

$cacheConfigurations  : array
$cacheGroups  : array
Used to flush caches of a specific group is an associative array containing the group identifier as key and the identifier as an array within that group groups are set via the cache configurations of each cache.
$caches  : FrontendInterface[]
$defaultCacheConfiguration  : array
$disableCaching  : bool

Methods

__construct()  : mixed
flushCaches()  : void
Flushes all registered caches
flushCachesByTag()  : void
Flushes entries tagged by the specified tag of all registered caches.
flushCachesByTags()  : void
Flushes entries tagged by any of the specified tags in all registered caches.
flushCachesInGroup()  : void
Flushes all registered caches of a specific group
flushCachesInGroupByTag()  : void
Flushes entries tagged by the specified tag of all registered caches of a specific group.
flushCachesInGroupByTags()  : void
Flushes entries tagged by any of the specified tags in all registered caches of a specific group.
getCache()  : FrontendInterface
Returns the cache specified by $identifier
getCacheGroups()  : string[]
handleCacheFlushEvent()  : void
hasCache()  : bool
Checks if the specified cache has been registered.
registerCache()  : void
Registers a cache so it can be retrieved at a later point.
setCacheConfigurations()  : void
Sets configurations for caches. The key of each entry specifies the cache identifier and the value is an array of configuration options.
createAllCaches()  : void
createCache()  : void
Instantiates the cache for $identifier.

Properties

$cacheConfigurations

protected array $cacheConfigurations = []

$cacheGroups

Used to flush caches of a specific group is an associative array containing the group identifier as key and the identifier as an array within that group groups are set via the cache configurations of each cache.

protected array $cacheGroups = []

$defaultCacheConfiguration

protected array $defaultCacheConfiguration = ['frontend' => \TYPO3\CMS\Core\Cache\Frontend\VariableFronte…
Show the full value['frontend' => \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class, 'backend' => \TYPO3\CMS\Core\Cache\Backend\Typo3DatabaseBackend::class, 'options' => [], 'groups' => ['all']]

$disableCaching

protected bool $disableCaching = false

Methods

__construct()

public __construct([bool $disableCaching = false ]) : mixed

Parameters

$disableCaching : bool = false

flushCaches()

Flushes all registered caches

public flushCaches() : void

flushCachesByTag()

Flushes entries tagged by the specified tag of all registered caches.

public flushCachesByTag(string $tag) : void

Parameters

$tag : string

flushCachesByTags()

Flushes entries tagged by any of the specified tags in all registered caches.

public flushCachesByTags(array $tags) : void

Parameters

$tags : array

flushCachesInGroup()

Flushes all registered caches of a specific group

public flushCachesInGroup(string $groupIdentifier) : void

Parameters

$groupIdentifier : string

Tags

throws
NoSuchCacheGroupException

flushCachesInGroupByTag()

Flushes entries tagged by the specified tag of all registered caches of a specific group.

public flushCachesInGroupByTag(string $groupIdentifier, string $tag) : void

Parameters

$groupIdentifier : string
$tag : string

Tags

throws
NoSuchCacheGroupException

flushCachesInGroupByTags()

Flushes entries tagged by any of the specified tags in all registered caches of a specific group.

public flushCachesInGroupByTags(string $groupIdentifier, array $tags) : void

Parameters

$groupIdentifier : string
$tags : array

Tags

throws
NoSuchCacheGroupException

getCacheGroups()

public getCacheGroups() : string[]

Return values

string[]

hasCache()

Checks if the specified cache has been registered.

public hasCache(string $identifier) : bool

Parameters

$identifier : string

Return values

bool

registerCache()

Registers a cache so it can be retrieved at a later point.

public registerCache(FrontendInterface $cache[, array $groups = [] ]) : void

Parameters

$cache : FrontendInterface
$groups : array = []

Cache groups to be associated to the cache

Tags

throws
DuplicateIdentifierException

if a cache with the given identifier has already been registered.

setCacheConfigurations()

Sets configurations for caches. The key of each entry specifies the cache identifier and the value is an array of configuration options.

public setCacheConfigurations(array<string, array> $cacheConfigurations) : void

Possible options are:

frontend backend backendOptions

If one of the options is not specified, the default value is assumed. Existing cache configurations are preserved.

Parameters

$cacheConfigurations : array<string, array>

The cache configurations to set

Tags

throws
InvalidArgumentException

If $cacheConfigurations is not an array

createAllCaches()

protected createAllCaches() : void
On this page