TYPO3  7.6
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CacheManager Class Reference
Inheritance diagram for CacheManager:
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)
 
 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 singleton

Definition at line 26 of file CacheManager.php.

Member Function Documentation

createAllCaches ( )
protected

Instantiates all registered caches.

Returns
void

Definition at line 347 of file CacheManager.php.

References CacheManager\createCache().

Referenced by CacheManager\flushCaches(), CacheManager\flushCachesByTag(), CacheManager\flushCachesInGroup(), and CacheManager\flushCachesInGroupByTag().

createCache (   $identifier)
protected

Instantiates the cache for $identifier.

Parameters
string$identifier
Returns
void

Definition at line 362 of file CacheManager.php.

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

flushCaches ( )

Flushes all registered caches

Returns
void

Definition at line 152 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 215 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 168 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$tagTag to search for
Returns
void
Exceptions
NoSuchCacheGroupException

Definition at line 192 of file CacheManager.php.

References CacheManager\createAllCaches().

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 241 of file CacheManager.php.

References $filename, elseif, and CacheManager\getCache().

getCache (   $identifier)

Returns the cache specified by $identifier

Parameters
string$identifierIdentifies which cache to return
Returns
The specified cache frontend
Exceptions
\TYPO3\CMS\Core\Cache\Exception\NoSuchCacheException

Definition at line 123 of file CacheManager.php.

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

Referenced by CacheManager\flushClassFileCachesByChangedFiles().

static 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 337 of file CacheManager.php.

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 CacheManager\getCache().

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 CacheManager\$cacheFactory.

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
\TYPO3\CMS\Core\Cache\Exception\DuplicateIdentifierExceptionif a cache with the given identifier has already been registered.

Definition at line 106 of file CacheManager.php.

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
\InvalidArgumentExceptionIf $cacheConfigurations is not an array

Definition at line 88 of file CacheManager.php.

Referenced by DatabaseSchemaService\getCachingFrameworkRequiredDatabaseSchema().

Member Data Documentation

$cacheConfigurations = array()
protected

Definition at line 41 of file CacheManager.php.

$cacheFactory
protected

Definition at line 31 of file CacheManager.php.

Referenced by CacheManager\injectCacheFactory().

$cacheGroups = array()
protected

Definition at line 51 of file CacheManager.php.

$caches = array()
protected

Definition at line 36 of file CacheManager.php.

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

Definition at line 56 of file CacheManager.php.