CacheManager implements SingletonInterface

The Cache Manager

Table of Contents

Interfaces

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

Properties

$cacheConfigurations  : array<string|int, mixed>
$cacheGroups  : array<string|int, mixed>
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  : array<string|int, FrontendInterface>
$defaultCacheConfiguration  : array<string|int, mixed>
$disableCaching  : bool

Methods

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

Properties

$cacheConfigurations

protected array<string|int, mixed> $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<string|int, mixed> $cacheGroups = []

$defaultCacheConfiguration

protected array<string|int, mixed> $defaultCacheConfiguration = ['frontend' => \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class, 'backend' => \TYPO3\CMS\Core\Cache\Backend\Typo3DatabaseBackend::class, 'options' => [], 'groups' => ['all']]

Default cache configuration as fallback

$disableCaching

protected bool $disableCaching = false

Methods

__construct()

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

flushCaches()

Flushes all registered caches

public flushCaches() : mixed

flushCachesByTag()

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

public flushCachesByTag(string $tag) : mixed
Parameters
$tag : string

Tag to search for

flushCachesByTags()

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

public flushCachesByTags(array<string|int, string> $tags) : mixed
Parameters
$tags : array<string|int, string>

Tags to search for

flushCachesInGroup()

Flushes all registered caches of a specific group

public flushCachesInGroup(string $groupIdentifier) : mixed
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|array<string|int, mixed> $tag) : mixed
Parameters
$groupIdentifier : string
$tag : string|array<string|int, mixed>

Tag to search for

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<string|int, string> $tags) : mixed
Parameters
$groupIdentifier : string
$tags : array<string|int, string>

Tags to search for

Tags
throws
NoSuchCacheGroupException

getCacheGroups()

public getCacheGroups() : array<string|int, string>
Internal
Return values
array<string|int, string>

hasCache()

Checks if the specified cache has been registered.

public hasCache(string $identifier) : bool
Parameters
$identifier : string

The identifier of the cache

Return values
bool

TRUE if a cache with the given identifier exists, otherwise FALSE

registerCache()

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

public registerCache(FrontendInterface $cache[, array<string|int, mixed> $groups = [] ]) : mixed
Parameters
$cache : FrontendInterface

The cache frontend to be registered

$groups : array<string|int, mixed> = []

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<string|int, mixed>> $cacheConfigurations) : mixed

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<string|int, mixed>>

The cache configurations to set

Tags
throws
InvalidArgumentException

If $cacheConfigurations is not an array

createAllCaches()

Instantiates all registered caches.

protected createAllCaches() : mixed

        
On this page

Search results