protected replaceUncachedPlaceholders ( Closure $uncachedCommandCallback, string &$content ) : string | ||
$uncachedCommandCallback | Closure | |
$content | string | The content potentially containing not cacheable segments marked by the respective tokens |
Résultat | string | The original content, but with uncached segments replaced by the actual content |
protected function replaceUncachedPlaceholders(\Closure $uncachedCommandCallback, &$content)
{
$cache = $this->cache;
$content = preg_replace_callback(self::EVAL_PLACEHOLDER_REGEX, function ($match) use($uncachedCommandCallback, $cache) {
$command = $match['command'];
$additionalData = json_decode($match['data'], true);
return $uncachedCommandCallback($command, $additionalData, $cache);
}, $content);
}