TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Core\Cache\CacheManager Class Reference
Inheritance diagram for TYPO3\CMS\Core\Cache\CacheManager:
TYPO3\CMS\Core\SingletonInterface

Public Member Functions

 injectCacheFactory (\TYPO3\CMS\Core\Cache\CacheFactory $cacheFactory)
 
 setCacheConfigurations (array $cacheConfigurations)
 
 registerCache (\TYPO3\CMS\Core\Cache\Frontend\FrontendInterface $cache)
 
 getCache ($identifier)
 
 hasCache ($identifier)
 
 flushCaches ()
 
 flushCachesInGroup ($groupIdentifier)
 
 flushCachesInGroupByTag ($groupIdentifier, $tag)
 
 flushCachesByTag ($tag)
 

Protected Member Functions

 createAllCaches ()
 
 createCache ($identifier)
 

Protected Attributes

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

Detailed Description

The Cache Manager

This file is a backport from FLOW3 singleton

Definition at line 26 of file CacheManager.php.

Member Function Documentation

◆ createAllCaches()

◆ createCache()

TYPO3\CMS\Core\Cache\CacheManager::createCache (   $identifier)
protected

Instantiates the cache for $identifier.

Parameters
string$identifier
Returns
void

Definition at line 242 of file CacheManager.php.

Referenced by TYPO3\CMS\Core\Cache\CacheManager\createAllCaches(), and TYPO3\CMS\Core\Cache\CacheManager\getCache().

◆ flushCaches()

TYPO3\CMS\Core\Cache\CacheManager::flushCaches ( )

Flushes all registered caches

Returns
void

Definition at line 152 of file CacheManager.php.

References TYPO3\CMS\Core\Cache\CacheManager\createAllCaches().

◆ flushCachesByTag()

TYPO3\CMS\Core\Cache\CacheManager::flushCachesByTag (   $tag)

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

Parameters
string$tagTag to search for
Returns
void

Definition at line 214 of file CacheManager.php.

References TYPO3\CMS\Core\Cache\CacheManager\createAllCaches().

◆ flushCachesInGroup()

TYPO3\CMS\Core\Cache\CacheManager::flushCachesInGroup (   $groupIdentifier)

Flushes all registered caches of a specific group

Parameters
string$groupIdentifier
Returns
void
Exceptions
NoSuchCacheGroupException

Definition at line 168 of file CacheManager.php.

References TYPO3\CMS\Core\Cache\CacheManager\createAllCaches().

◆ flushCachesInGroupByTag()

TYPO3\CMS\Core\Cache\CacheManager::flushCachesInGroupByTag (   $groupIdentifier,
  $tag 
)

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

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

Definition at line 192 of file CacheManager.php.

References TYPO3\CMS\Core\Cache\CacheManager\createAllCaches().

◆ getCache()

TYPO3\CMS\Core\Cache\CacheManager::getCache (   $identifier)

Returns the cache specified by $identifier

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

Definition at line 123 of file CacheManager.php.

References TYPO3\CMS\Core\Cache\CacheManager\createCache(), and TYPO3\CMS\Core\Cache\CacheManager\hasCache().

◆ hasCache()

TYPO3\CMS\Core\Cache\CacheManager::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 141 of file CacheManager.php.

Referenced by TYPO3\CMS\Core\Cache\CacheManager\getCache().

◆ injectCacheFactory()

TYPO3\CMS\Core\Cache\CacheManager::injectCacheFactory ( \TYPO3\CMS\Core\Cache\CacheFactory  $cacheFactory)
Parameters
\TYPO3\CMS\Core\Cache\CacheFactory$cacheFactory
Returns
void

Definition at line 67 of file CacheManager.php.

References TYPO3\CMS\Core\Cache\CacheManager\$cacheFactory.

◆ registerCache()

TYPO3\CMS\Core\Cache\CacheManager::registerCache ( \TYPO3\CMS\Core\Cache\Frontend\FrontendInterface  $cache)

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

Parameters
\TYPO3\CMS\Core\Cache\Frontend\FrontendInterface$cacheThe cache frontend to be registered
Returns
void
Exceptions

Definition at line 106 of file CacheManager.php.

◆ setCacheConfigurations()

TYPO3\CMS\Core\Cache\CacheManager::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

Definition at line 88 of file CacheManager.php.

Referenced by TYPO3\CMS\Core\Cache\DatabaseSchemaService\getCachingFrameworkRequiredDatabaseSchema().

Member Data Documentation

◆ $cacheConfigurations

TYPO3\CMS\Core\Cache\CacheManager::$cacheConfigurations = []
protected

Definition at line 41 of file CacheManager.php.

◆ $cacheFactory

TYPO3\CMS\Core\Cache\CacheManager::$cacheFactory
protected

◆ $cacheGroups

TYPO3\CMS\Core\Cache\CacheManager::$cacheGroups = []
protected

Definition at line 51 of file CacheManager.php.

◆ $caches

TYPO3\CMS\Core\Cache\CacheManager::$caches = []
protected

Definition at line 36 of file CacheManager.php.

◆ $defaultCacheConfiguration

TYPO3\CMS\Core\Cache\CacheManager::$defaultCacheConfiguration
protected
Initial value:
= [
'frontend' => \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class

Definition at line 56 of file CacheManager.php.