TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
CacheManager Class Reference
Inheritance diagram for CacheManager:
SingletonInterface

Public Member Functions

 setCacheConfigurations (array $cacheConfigurations)
 
 registerCache (FrontendInterface $cache)
 
 getCache ($identifier)
 
 hasCache ($identifier)
 
 flushCaches ()
 
 flushCachesInGroup ($groupIdentifier)
 
 flushCachesInGroupByTag ($groupIdentifier, $tag)
 
 flushCachesInGroupByTags ($groupIdentifier, array $tags)
 
 flushCachesByTag ($tag)
 
 flushCachesByTags (array $tags)
 

Protected Member Functions

 createAllCaches ()
 
 createCache ($identifier)
 

Protected Attributes

 $caches = []
 
 $cacheConfigurations = []
 
 $cacheGroups = []
 
 $defaultCacheConfiguration
 

Detailed Description

The Cache Manager

This file is a backport from FLOW3 singleton

Definition at line 35 of file CacheManager.php.

Member Function Documentation

createCache (   $identifier)
protected

Instantiates the cache for $identifier.

Parameters
string$identifier
Exceptions
DuplicateIdentifierException
InvalidBackendException
InvalidCacheException

Definition at line 281 of file CacheManager.php.

References CacheManager\registerCache().

Referenced by CacheManager\createAllCaches(), and CacheManager\getCache().

flushCaches ( )

Flushes all registered caches

Returns
void

Definition at line 147 of file CacheManager.php.

References CacheManager\createAllCaches().

flushCachesByTag (   $tag)

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

Parameters
string$tagTag to search for
Returns
void

Definition at line 236 of file CacheManager.php.

References CacheManager\createAllCaches().

flushCachesByTags ( array  $tags)

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

Parameters
string[]$tag Tags to search for
Returns
void

Definition at line 251 of file CacheManager.php.

References CacheManager\createAllCaches().

flushCachesInGroup (   $groupIdentifier)

Flushes all registered caches of a specific group

Parameters
string$groupIdentifier
Returns
void
Exceptions
NoSuchCacheGroupException

Definition at line 163 of file CacheManager.php.

References CacheManager\createAllCaches().

flushCachesInGroupByTag (   $groupIdentifier,
  $tag 
)

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

Parameters
string$groupIdentifier
string | array$tagTag to search for
Returns
void
Exceptions
NoSuchCacheGroupException

Definition at line 186 of file CacheManager.php.

References CacheManager\createAllCaches().

flushCachesInGroupByTags (   $groupIdentifier,
array  $tags 
)

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

Parameters
string$groupIdentifier
string[]$tag Tags to search for
Returns
void
Exceptions
NoSuchCacheGroupException

Definition at line 212 of file CacheManager.php.

References CacheManager\createAllCaches().

getCache (   $identifier)

Returns the cache specified by $identifier

Parameters
string$identifierIdentifies which cache to return
Returns
FrontendInterface The specified cache frontend
Exceptions
NoSuchCacheException

Definition at line 118 of file CacheManager.php.

References CacheManager\createCache(), and CacheManager\hasCache().

hasCache (   $identifier)

Checks if the specified cache has been registered.

Parameters
string$identifierThe identifier of the cache
Returns
bool TRUE if a cache with the given identifier exists, otherwise FALSE

Definition at line 136 of file CacheManager.php.

Referenced by CacheManager\getCache().

registerCache ( FrontendInterface  $cache)

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

Parameters
FrontendInterface$cacheThe cache frontend to be registered
Returns
void
Exceptions
DuplicateIdentifierExceptionif a cache with the given identifier has already been registered.

Definition at line 101 of file CacheManager.php.

References FrontendInterface\getIdentifier().

Referenced by CacheManager\createCache().

setCacheConfigurations ( array  $cacheConfigurations)

Sets configurations for caches. The key of each entry specifies the cache identifier and the value is an array of configuration options. 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
array$cacheConfigurationsThe cache configurations to set
Returns
void
Exceptions
InvalidArgumentException If $cacheConfigurations is not an array

Definition at line 83 of file CacheManager.php.

Member Data Documentation

$cacheConfigurations = []
protected

Definition at line 45 of file CacheManager.php.

$cacheGroups = []
protected

Definition at line 55 of file CacheManager.php.

$caches = []
protected

Definition at line 40 of file CacheManager.php.

$defaultCacheConfiguration
protected
Initial value:
= [
'frontend' => VariableFrontend::class

Definition at line 60 of file CacheManager.php.