Skip to content

Commit 6265312

Browse files
committed
BUGFIX: Keep Neos 8.x compatibility
1 parent 9ef5dcd commit 6265312

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

Classes/Aspects/ContentCacheAspect.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
namespace Flowpack\FullPageCache\Aspects;
34

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

39+
/**
40+
* This aspect is for Neos 8.x compatibility and can be removed, when Neos 8.x isn't supported anymore.
41+
* See: ContentCacheAspect::interceptNodeCacheFlush() for Neos 9.x cache flushing
42+
*
43+
* @Flow\Before("method(Neos\Neos\Fusion\Cache\ContentCacheFlusher->commit())")
44+
* @param JoinPointInterface $joinPoint
45+
*
46+
* @throws \Neos\Utility\Exception\PropertyNotAccessibleException
47+
*/
48+
public function interceptLegacyNodeCacheFlush(JoinPointInterface $joinPoint)
49+
{
50+
$object = $joinPoint->getProxy();
51+
52+
$tags = ObjectAccess::getProperty($object, 'tagsToFlush', true);
53+
$tags = array_map([$this, 'sanitizeTag'], array_keys($tags));
54+
$this->cacheFrontend->flushByTags($tags);
55+
}
56+
3857
/**
3958
* @Flow\Before("method(Neos\Neos\Fusion\Cache\ContentCacheFlusher->flushTagsImmediately())")
4059
* @param JoinPointInterface $joinPoint

0 commit comments

Comments
 (0)