preEvaluate() 공개 메소드

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)
리턴 array Cache hit state as boolean and value as mixed
예제 #1
0
 /**
  * Does the evaluation of a TypoScript instance, first checking the cache and if conditions and afterwards applying processors.
  *
  * @param AbstractTypoScriptObject $typoScriptObject
  * @param string $typoScriptPath
  * @param array $typoScriptConfiguration
  * @param array $cacheContext
  * @return mixed
  */
 protected function evaluateObjectOrRetrieveFromCache($typoScriptObject, $typoScriptPath, $typoScriptConfiguration, $cacheContext)
 {
     $output = null;
     $evaluationStatus = self::EVALUATION_SKIPPED;
     list($cacheHit, $cachedResult) = $this->runtimeContentCache->preEvaluate($cacheContext, $typoScriptObject);
     if ($cacheHit) {
         return $cachedResult;
     }
     $evaluateObject = true;
     if ($this->evaluateIfCondition($typoScriptConfiguration, $typoScriptPath, $typoScriptObject) === false) {
         $evaluateObject = false;
     }
     if ($evaluateObject) {
         $output = $typoScriptObject->evaluate();
         $evaluationStatus = self::EVALUATION_EXECUTED;
     }
     $this->lastEvaluationStatus = $evaluationStatus;
     if ($evaluateObject) {
         $output = $this->evaluateProcessors($output, $typoScriptConfiguration, $typoScriptPath, $typoScriptObject);
     }
     $output = $this->runtimeContentCache->postProcess($cacheContext, $typoScriptObject, $output);
     return $output;
 }