PHP Class Neos\Flow\Cache\CacheManager

Show file Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Property Type Description
$cacheConfigurations array
$cacheFactory CacheFactory
$caches array
$configurationManager Neos\Flow\Configuration\ConfigurationManager
$environment Neos\Flow\Utility\Environment
$persistentCaches array
$systemLogger Neos\Flow\Log\SystemLoggerInterface

Public Methods

Method Description
flushCaches ( boolean $flushPersistentCaches = false ) : void Flushes all registered caches
flushCachesByTag ( string $tag, boolean $flushPersistentCaches = false ) : void Flushes entries tagged by the specified tag of all registered caches.
flushSystemCachesByChangedFiles ( string $fileMonitorIdentifier, array $changedFiles ) : void Flushes entries tagged with class names if their class source files have changed.
getCache ( string $identifier ) : Neos\Cache\Frontend\FrontendInterface Returns the cache specified by $identifier
getCacheConfigurations ( ) : array Returns an array of cache configurations, indexed by cache identifier
getClassTag ( string $className = '' ) : string Renders a tag which can be used to mark a cache entry as "depends on this class".
hasCache ( string $identifier ) : boolean Checks if the specified cache has been registered.
injectCacheFactory ( CacheFactory $cacheFactory ) : void
injectConfigurationManager ( ConfigurationManager $configurationManager ) : void
injectEnvironment ( Environment $environment ) : void
injectSystemLogger ( Neos\Flow\Log\SystemLoggerInterface $systemLogger ) : void
isCachePersistent ( string $identifier ) : boolean Checks if the specified cache is marked as "persistent".
registerCache ( Neos\Cache\Frontend\FrontendInterface $cache, boolean $persistent = false ) : void Registers a cache so it can be retrieved at a later point.
setCacheConfigurations ( array $cacheConfigurations ) : void Sets configurations for caches. The key of each entry specifies the cache identifier and the value is an array of configuration options.

Protected Methods

Method Description
createAllCaches ( ) : void Instantiates all registered caches.
createCache ( string $identifier ) : void Instantiates the cache for $identifier.
flushClassCachesByChangedFiles ( array $changedFiles ) : void Flushes entries tagged with class names if their class source files have changed.
flushConfigurationCachesByChangedFiles ( array $changedFiles ) : void Flushes caches as needed if settings, routes or policies have changed
flushTranslationCachesByChangedFiles ( array $changedFiles ) : void Flushes I18n caches if translation files have changed

Method Details

createAllCaches() protected method

Instantiates all registered caches.
protected createAllCaches ( ) : void
return void

createCache() protected method

Instantiates the cache for $identifier.
protected createCache ( string $identifier ) : void
$identifier string
return void

flushCaches() public method

Flushes all registered caches
public flushCaches ( boolean $flushPersistentCaches = false ) : void
$flushPersistentCaches boolean If set to TRUE, even those caches which are flagged as "persistent" will be flushed
return void

flushCachesByTag() public method

Flushes entries tagged by the specified tag of all registered caches.
public flushCachesByTag ( string $tag, boolean $flushPersistentCaches = false ) : void
$tag string Tag to search for
$flushPersistentCaches boolean If set to TRUE, even those caches which are flagged as "persistent" will be flushed
return void

flushClassCachesByChangedFiles() protected method

Flushes entries tagged with class names if their class source files have changed.
See also: flushSystemCachesByChangedFiles()
protected flushClassCachesByChangedFiles ( array $changedFiles ) : void
$changedFiles array A list of full paths to changed files
return void

flushConfigurationCachesByChangedFiles() protected method

Flushes caches as needed if settings, routes or policies have changed
See also: flushSystemCachesByChangedFiles()
protected flushConfigurationCachesByChangedFiles ( array $changedFiles ) : void
$changedFiles array A list of full paths to changed files
return void

flushSystemCachesByChangedFiles() public method

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 Flow (like the security framework) are not fully initialized at the time needed.
public flushSystemCachesByChangedFiles ( string $fileMonitorIdentifier, array $changedFiles ) : void
$fileMonitorIdentifier string Identifier of the File Monitor
$changedFiles array A list of full paths to changed files
return void

flushTranslationCachesByChangedFiles() protected method

Flushes I18n caches if translation files have changed
See also: flushSystemCachesByChangedFiles()
protected flushTranslationCachesByChangedFiles ( array $changedFiles ) : void
$changedFiles array A list of full paths to changed files
return void

getCache() public method

Returns the cache specified by $identifier
public getCache ( string $identifier ) : Neos\Cache\Frontend\FrontendInterface
$identifier string Identifies which cache to return
return Neos\Cache\Frontend\FrontendInterface The specified cache frontend

getCacheConfigurations() public method

Returns an array of cache configurations, indexed by cache identifier
public getCacheConfigurations ( ) : array
return array

getClassTag() public static method

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".
Deprecation: Unused and described functionality does not exist.
public static getClassTag ( string $className = '' ) : string
$className string The class name
return string Class Tag

hasCache() public method

Checks if the specified cache has been registered.
public hasCache ( string $identifier ) : boolean
$identifier string The identifier of the cache
return boolean TRUE if a cache with the given identifier exists, otherwise FALSE

injectCacheFactory() public method

public injectCacheFactory ( CacheFactory $cacheFactory ) : void
$cacheFactory CacheFactory
return void

injectConfigurationManager() public method

public injectConfigurationManager ( ConfigurationManager $configurationManager ) : void
$configurationManager Neos\Flow\Configuration\ConfigurationManager
return void

injectEnvironment() public method

public injectEnvironment ( Environment $environment ) : void
$environment Neos\Flow\Utility\Environment
return void

injectSystemLogger() public method

public injectSystemLogger ( Neos\Flow\Log\SystemLoggerInterface $systemLogger ) : void
$systemLogger Neos\Flow\Log\SystemLoggerInterface
return void

isCachePersistent() public method

Checks if the specified cache is marked as "persistent".
public isCachePersistent ( string $identifier ) : boolean
$identifier string The identifier of the cache
return boolean TRUE if the specified cache is persistent, FALSE if it is not, or if the cache does not exist

registerCache() public method

Registers a cache so it can be retrieved at a later point.
public registerCache ( Neos\Cache\Frontend\FrontendInterface $cache, boolean $persistent = false ) : void
$cache Neos\Cache\Frontend\FrontendInterface The cache frontend to be registered
$persistent boolean
return void

setCacheConfigurations() public method

Possible options are: frontend backend backendOptions persistent If one of the options is not specified, the default value is assumed. Existing cache configurations are preserved.
public setCacheConfigurations ( array $cacheConfigurations ) : void
$cacheConfigurations array The cache configurations to set
return void

Property Details

$cacheConfigurations protected property

protected array $cacheConfigurations
return array

$cacheFactory protected property

protected CacheFactory,Neos\Flow\Cache $cacheFactory
return CacheFactory

$caches protected property

protected array $caches
return array

$configurationManager protected property

protected ConfigurationManager,Neos\Flow\Configuration $configurationManager
return Neos\Flow\Configuration\ConfigurationManager

$environment protected property

protected Environment,Neos\Flow\Utility $environment
return Neos\Flow\Utility\Environment

$persistentCaches protected property

protected array $persistentCaches
return array

$systemLogger protected property

protected SystemLoggerInterface,Neos\Flow\Log $systemLogger
return Neos\Flow\Log\SystemLoggerInterface