PHP Class Neos\Flow\Cache\CacheManager

Afficher le fichier Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Свойство 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

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode 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 méthode

Instantiates all registered caches.
protected createAllCaches ( ) : void
Résultat void

createCache() protected méthode

Instantiates the cache for $identifier.
protected createCache ( string $identifier ) : void
$identifier string
Résultat void

flushCaches() public méthode

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
Résultat void

flushCachesByTag() public méthode

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
Résultat void

flushClassCachesByChangedFiles() protected méthode

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
Résultat void

flushConfigurationCachesByChangedFiles() protected méthode

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
Résultat void

flushSystemCachesByChangedFiles() public méthode

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
Résultat void

flushTranslationCachesByChangedFiles() protected méthode

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
Résultat void

getCache() public méthode

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

getCacheConfigurations() public méthode

Returns an array of cache configurations, indexed by cache identifier
public getCacheConfigurations ( ) : array
Résultat array

getClassTag() public static méthode

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
Résultat string Class Tag

hasCache() public méthode

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

injectCacheFactory() public méthode

public injectCacheFactory ( CacheFactory $cacheFactory ) : void
$cacheFactory CacheFactory
Résultat void

injectConfigurationManager() public méthode

public injectConfigurationManager ( ConfigurationManager $configurationManager ) : void
$configurationManager Neos\Flow\Configuration\ConfigurationManager
Résultat void

injectEnvironment() public méthode

public injectEnvironment ( Environment $environment ) : void
$environment Neos\Flow\Utility\Environment
Résultat void

injectSystemLogger() public méthode

public injectSystemLogger ( Neos\Flow\Log\SystemLoggerInterface $systemLogger ) : void
$systemLogger Neos\Flow\Log\SystemLoggerInterface
Résultat void

isCachePersistent() public méthode

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

registerCache() public méthode

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
Résultat void

setCacheConfigurations() public méthode

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
Résultat void

Property Details

$cacheConfigurations protected_oe property

protected array $cacheConfigurations
Résultat array

$cacheFactory protected_oe property

protected CacheFactory,Neos\Flow\Cache $cacheFactory
Résultat CacheFactory

$caches protected_oe property

protected array $caches
Résultat array

$configurationManager protected_oe property

protected ConfigurationManager,Neos\Flow\Configuration $configurationManager
Résultat Neos\Flow\Configuration\ConfigurationManager

$environment protected_oe property

protected Environment,Neos\Flow\Utility $environment
Résultat Neos\Flow\Utility\Environment

$persistentCaches protected_oe property

protected array $persistentCaches
Résultat array

$systemLogger protected_oe property

protected SystemLoggerInterface,Neos\Flow\Log $systemLogger
Résultat Neos\Flow\Log\SystemLoggerInterface