Skip to content

Commit

Permalink
BUGFIX: Keep Neos 8.x compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
dlubitz committed Jan 3, 2025
1 parent 9ef5dcd commit 6265312
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Classes/Aspects/ContentCacheAspect.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace Flowpack\FullPageCache\Aspects;

use Neos\Cache\Frontend\StringFrontend;
Expand Down Expand Up @@ -35,6 +36,24 @@ public function grabUncachedSegment(JoinPointInterface $joinPoint)
$this->hadUncachedSegments = true;
}

/**
* This aspect is for Neos 8.x compatibility and can be removed, when Neos 8.x isn't supported anymore.
* See: ContentCacheAspect::interceptNodeCacheFlush() for Neos 9.x cache flushing
*
* @Flow\Before("method(Neos\Neos\Fusion\Cache\ContentCacheFlusher->commit())")
* @param JoinPointInterface $joinPoint
*
* @throws \Neos\Utility\Exception\PropertyNotAccessibleException
*/
public function interceptLegacyNodeCacheFlush(JoinPointInterface $joinPoint)
{
$object = $joinPoint->getProxy();

$tags = ObjectAccess::getProperty($object, 'tagsToFlush', true);
$tags = array_map([$this, 'sanitizeTag'], array_keys($tags));
$this->cacheFrontend->flushByTags($tags);
}

/**
* @Flow\Before("method(Neos\Neos\Fusion\Cache\ContentCacheFlusher->flushTagsImmediately())")
* @param JoinPointInterface $joinPoint
Expand Down

0 comments on commit 6265312

Please sign in to comment.