11<?php
2+
23namespace Flowpack \FullPageCache \Aspects ;
34
45use Neos \Cache \Frontend \StringFrontend ;
@@ -36,12 +37,15 @@ public function grabUncachedSegment(JoinPointInterface $joinPoint)
3637 }
3738
3839 /**
39- * @Flow\Before("method(Neos\Neos\Fusion\Cache\ContentCacheFlusher->shutdownObject())")
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())")
4044 * @param JoinPointInterface $joinPoint
4145 *
4246 * @throws \Neos\Utility\Exception\PropertyNotAccessibleException
4347 */
44- public function interceptNodeCacheFlush (JoinPointInterface $ joinPoint )
48+ public function interceptLegacyNodeCacheFlush (JoinPointInterface $ joinPoint )
4549 {
4650 $ object = $ joinPoint ->getProxy ();
4751
@@ -50,6 +54,19 @@ public function interceptNodeCacheFlush(JoinPointInterface $joinPoint)
5054 $ this ->cacheFrontend ->flushByTags ($ tags );
5155 }
5256
57+ /**
58+ * @Flow\Before("method(Neos\Neos\Fusion\Cache\ContentCacheFlusher->flushTagsImmediately())")
59+ * @param JoinPointInterface $joinPoint
60+ *
61+ * @throws \Neos\Utility\Exception\PropertyNotAccessibleException
62+ */
63+ public function interceptNodeCacheFlush (JoinPointInterface $ joinPoint )
64+ {
65+ $ tags = $ joinPoint ->getMethodArgument ('tagsToFlush ' );
66+ $ tags = array_map ([$ this , 'sanitizeTag ' ], array_keys ($ tags ));
67+ $ this ->cacheFrontend ->flushByTags ($ tags );
68+ }
69+
5370 /**
5471 * @return bool
5572 */
0 commit comments