TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Core\Cache\CacheManager Class Reference
Inheritance diagram for TYPO3\CMS\Core\Cache\CacheManager:
TYPO3\CMS\Core\SingletonInterface t3lib_cache_Manager

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)
 
 flushClassFileCachesByChangedFiles ($fileMonitorIdentifier, array $changedFiles)
 

Static Public Member Functions

static getClassTag ($className='')
 

Protected Member Functions

 createAllCaches ()
 
 createCache ($identifier)
 

Protected Attributes

 $cacheFactory
 
 $caches = array()
 
 $cacheConfigurations = array()
 
 $cacheGroups = array()
 
 $defaultCacheConfiguration
 

Detailed Description

The Cache Manager

This file is a backport from FLOW3

Author
Robert Lemke rober.nosp@m.t@ty.nosp@m.po3.o.nosp@m.rg singleton

Definition at line 29 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 353 of file CacheManager.php.

References $backend.

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 150 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 210 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 165 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 188 of file CacheManager.php.

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

◆ flushClassFileCachesByChangedFiles()

TYPO3\CMS\Core\Cache\CacheManager::flushClassFileCachesByChangedFiles (   $fileMonitorIdentifier,
array  $changedFiles 
)

TYPO3 v4 note: This method is a direct backport from FLOW3 and currently unused in TYPO3 v4 context.

Flushes entries tagged with class names if their class source files have changed. Also flushes AOP proxy caches if a policy was modified.

This method is used as a slot for a signal sent by the system file monitor defined in the bootstrap scripts.

Note: Policy configuration handling is implemented here as well as other parts of FLOW3 (like the security framework) are not fully initialized at the time needed.

Parameters
string$fileMonitorIdentifierIdentifier of the File Monitor
array$changedFilesA list of full paths to changed files
Returns
void

Definition at line 235 of file CacheManager.php.

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

◆ 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().

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

◆ getClassTag()

static TYPO3\CMS\Core\Cache\CacheManager::getClassTag (   $className = '')
static

TYPO3 v4 note: This method is a direct backport from FLOW3 and currently unused in TYPO3 v4 context.

Renders a tag which can be used to mark a cache entry as "depends on this class". Whenever the specified class is modified, all cache entries tagged with the class are flushed.

If an empty string is specified as class name, the returned tag means "this cache entry becomes invalid if any of the known classes changes".

Parameters
string$classNameThe class name
Returns
string Class Tag

Definition at line 330 of file CacheManager.php.

References TYPO3\CMS\Core\Cache\Frontend\FrontendInterface\TAG_CLASS.

◆ hasCache()

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

Checks if the specified cache has been registered.

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

Definition at line 140 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 70 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 107 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 90 of file CacheManager.php.

Member Data Documentation

◆ $cacheConfigurations

TYPO3\CMS\Core\Cache\CacheManager::$cacheConfigurations = array()
protected

Definition at line 44 of file CacheManager.php.

◆ $cacheFactory

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

◆ $cacheGroups

TYPO3\CMS\Core\Cache\CacheManager::$cacheGroups = array()
protected

Definition at line 54 of file CacheManager.php.

◆ $caches

TYPO3\CMS\Core\Cache\CacheManager::$caches = array()
protected

Definition at line 39 of file CacheManager.php.

◆ $defaultCacheConfiguration

TYPO3\CMS\Core\Cache\CacheManager::$defaultCacheConfiguration
protected
Initial value:
= array(
'frontend' => 'TYPO3\\CMS\\Core\\Cache\\Frontend\\VariableFrontend',
'backend' => 'TYPO3\\CMS\\Core\\Cache\\Backend\\Typo3DatabaseBackend',
'options' => array(),
'groups' => array('all')
)

Definition at line 59 of file CacheManager.php.