PHP Class Neos\Fusion\Core\Cache\RuntimeContentCache

Holds cache related runtime state.
Afficher le fichier Open project: neos/neos-development-collection Class Usage Examples

Protected Properties

Свойство Type Description
$addCacheSegmentMarkersToPlaceholders boolean
$cacheMetadata array Stack of cached segment metadata (lifetime)
$contentCache ContentCache
$enableContentCache boolean
$inCacheEntryPoint boolean
$propertyMapper Neos\Flow\Property\PropertyMapper
$runtime Neos\Fusion\Core\Runtime
$tags array

Méthodes publiques

Méthode Description
__construct ( Runtime $runtime )
addTag ( string $key, string $value ) : void Adds a tag built from the given key and value.
enter ( array $configuration, string $typoScriptPath ) : array Enter an evaluation
evaluateUncached ( string $path, array $contextArray ) : mixed Evaluate a TypoScript path with a given context without content caching
getEnableContentCache ( ) : boolean
leave ( array $evaluateContext ) : void Leave the evaluation of a path
postProcess ( array $evaluateContext, object $tsObject, mixed $output ) : mixed Post process output for caching information
preEvaluate ( array &$evaluateContext, object $tsObject ) : array Check for cached evaluation and or collect metadata for evaluation
setEnableContentCache ( boolean $enableContentCache ) : void
unserializeContext ( array $contextArray ) : array

Méthodes protégées

Méthode Description
buildCacheIdentifierValues ( array $configuration, string $typoScriptPath, object $tsObject ) : array Builds an array of additional key / values which must go into the calculation of the cache entry identifier for a cached content segment.
buildCacheTags ( array $configuration, string $typoScriptPath, object $tsObject ) : array Builds an array of string which must be used as tags for the cache entry identifier of a specific cached content segment.
flushTags ( ) : array Resets the assigned tags, returning the previously set tags.

Method Details

__construct() public méthode

public __construct ( Runtime $runtime )
$runtime Neos\Fusion\Core\Runtime

addTag() public méthode

Adds a tag built from the given key and value.
public addTag ( string $key, string $value ) : void
$key string
$value string
Résultat void

buildCacheIdentifierValues() protected méthode

Builds an array of additional key / values which must go into the calculation of the cache entry identifier for a cached content segment.
protected buildCacheIdentifierValues ( array $configuration, string $typoScriptPath, object $tsObject ) : array
$configuration array
$typoScriptPath string
$tsObject object The actual TypoScript object
Résultat array

buildCacheTags() protected méthode

Builds an array of string which must be used as tags for the cache entry identifier of a specific cached content segment.
protected buildCacheTags ( array $configuration, string $typoScriptPath, object $tsObject ) : array
$configuration array
$typoScriptPath string
$tsObject object The actual TypoScript object
Résultat array

enter() public méthode

Needs to be called right before evaluation of a path starts to check the cache mode and set internal state like the cache entry point.
public enter ( array $configuration, string $typoScriptPath ) : array
$configuration array
$typoScriptPath string
Résultat array An evaluate context array that needs to be passed to subsequent calls to pass the current state

evaluateUncached() public méthode

This is used to render uncached segments "out of band" in getCachedSegment of ContentCache.
public evaluateUncached ( string $path, array $contextArray ) : mixed
$path string
$contextArray array
Résultat mixed TODO Find another way of disabling the cache (especially to allow cached content inside uncached content)

flushTags() protected méthode

Resets the assigned tags, returning the previously set tags.
protected flushTags ( ) : array
Résultat array

getEnableContentCache() public méthode

public getEnableContentCache ( ) : boolean
Résultat boolean

leave() public méthode

Has to be called in the same function calling enter() for every return path.
public leave ( array $evaluateContext ) : void
$evaluateContext array The current evaluation context
Résultat void

postProcess() public méthode

The content cache stores cache segments with markers inside the generated content. This method creates cache segments and will process the final outer result (currentPathIsEntryPoint) to remove all cache markers and store cache entries.
public postProcess ( array $evaluateContext, object $tsObject, mixed $output ) : mixed
$evaluateContext array The current evaluation context
$tsObject object The current TypoScript object (for "this" in evaluations)
$output mixed The generated output after caching information was removed
Résultat mixed The post-processed output with cache segment markers or cleaned for the entry point

preEvaluate() public méthode

Try to get a cached segment for the current path and return that with all uncached segments evaluated if it exists. Otherwise metadata for the cache lifetime is collected (if configured) for nested evaluations (to find the minimum maximumLifetime).
public preEvaluate ( array &$evaluateContext, object $tsObject ) : array
$evaluateContext array The current evaluation context
$tsObject object The current TypoScript object (for "this" in evaluations)
Résultat array Cache hit state as boolean and value as mixed

setEnableContentCache() public méthode

public setEnableContentCache ( boolean $enableContentCache ) : void
$enableContentCache boolean
Résultat void

unserializeContext() public méthode

public unserializeContext ( array $contextArray ) : array
$contextArray array
Résultat array

Property Details

$addCacheSegmentMarkersToPlaceholders protected_oe property

protected bool $addCacheSegmentMarkersToPlaceholders
Résultat boolean

$cacheMetadata protected_oe property

Stack of cached segment metadata (lifetime)
protected array $cacheMetadata
Résultat array

$contentCache protected_oe property

protected ContentCache,Neos\Fusion\Core\Cache $contentCache
Résultat ContentCache

$enableContentCache protected_oe property

protected bool $enableContentCache
Résultat boolean

$inCacheEntryPoint protected_oe property

protected bool $inCacheEntryPoint
Résultat boolean

$propertyMapper protected_oe property

protected PropertyMapper,Neos\Flow\Property $propertyMapper
Résultat Neos\Flow\Property\PropertyMapper

$runtime protected_oe property

protected Runtime,Neos\Fusion\Core $runtime
Résultat Neos\Fusion\Core\Runtime

$tags protected_oe property

protected array $tags
Résultat array