Neos.Fusion/Classes/Core/Cache/ContentCache.php
protected function replaceCachePlaceholders(&$content, $addCacheSegmentMarkersToPlaceholders)
    {
        $cache = $this->cache;
        $foundMissingIdentifier = false;
        $content = preg_replace_callback(self::CACHE_PLACEHOLDER_REGEX, function ($match) use ($cache, &$foundMissingIdentifier, $addCacheSegmentMarkersToPlaceholders) {
            $identifier = $match['identifier'];
            $entry = $cache->get($identifier);
            if ($entry !== false) {
                if ($addCacheSegmentMarkersToPlaceholders) {
                    return ContentCache::CACHE_SEGMENT_START_TOKEN . $this->randomCacheMarker . $identifier . ContentCache::CACHE_SEGMENT_SEPARATOR_TOKEN . $this->randomCacheMarker . '*' . ContentCache::CACHE_SEGMENT_SEPARATOR_TOKEN . $this->randomCacheMarker . $entry . ContentCache::CACHE_SEGMENT_END_TOKEN . $this->randomCacheMarker;
                } else {
                    return $entry;
                }
            } else {
                $foundMissingIdentifier = true;
                return '';
            }
        }, $content, -1, $count);
        if ($foundMissingIdentifier) {
            return false;
        }
        return $count;
    }
protected function replaceCachePlaceholders(&$content, $addCacheSegmentMarkersToPlaceholders)
    {
        $cache = $this->cache;
        $foundMissingIdentifier = false;
        $content = preg_replace_callback(self::CACHE_PLACEHOLDER_REGEX, function ($match) use ($cache, &$foundMissingIdentifier, $addCacheSegmentMarkersToPlaceholders) {
            $identifier = $match['identifier'];
            $entry = $cache->get($identifier);
            if ($entry !== false) {
                if ($addCacheSegmentMarkersToPlaceholders) {
                    return ContentCache::CACHE_SEGMENT_START_TOKEN . $this->randomCacheMarker . $identifier . ContentCache::CACHE_SEGMENT_SEPARATOR_TOKEN . $this->randomCacheMarker . '*' . ContentCache::CACHE_SEGMENT_SEPARATOR_TOKEN . $this->randomCacheMarker . $entry . ContentCache::CACHE_SEGMENT_END_TOKEN . $this->randomCacheMarker;
                } else {
                    return $entry;
                }
            } else {
                $foundMissingIdentifier = true;
                return '';
            }
        }, $content, -1, $count);
        if ($foundMissingIdentifier) {
            return false;
        }
        return $count;
    }
protected function replaceCachePlaceholders ( & $ content , $ addCacheSegmentMarkersToPlaceholders ) { $ cache = $ this -> cache ; $ foundMissingIdentifier = false ; $ content = preg_replace_callback ( self :: CACHE_PLACEHOLDER_REGEX , function ( $ match ) use ( $ cache , & $ foundMissingIdentifier , $ addCacheSegmentMarkersToPlaceholders ) { $ identifier = $ match [ 'identifier' ] ; $ entry = $ cache -> get ( $ identifier ) ; if ( $ entry !== false ) { if ( $ addCacheSegmentMarkersToPlaceholders ) { return ContentCache :: CACHE_SEGMENT_START_TOKEN . $ this -> randomCacheMarker . $ identifier . ContentCache :: CACHE_SEGMENT_SEPARATOR_TOKEN . $ this -> randomCacheMarker . '*' . ContentCache :: CACHE_SEGMENT_SEPARATOR_TOKEN . $ this -> randomCacheMarker . $ entry . ContentCache :: CACHE_SEGMENT_END_TOKEN . $ this -> randomCacheMarker ; } else { return $ entry ; } } else { $ foundMissingIdentifier = true ; return '' ; } } , $ content , - 1 , $ count ) ; if ( $ foundMissingIdentifier ) { return false ; } return $ count ; }
Find cache placeholders in a cached segment and return the identifiers

@param string $content
@param boolean $addCacheSegmentMarkersToPlaceholders
@return integer|boolean Number of replaced placeholders or false if a placeholder couldn't be found
Find cache placeholders in a cached segment and return the identifiers