1
1
<?php
2
+
2
3
namespace Flowpack \FullPageCache \Aspects ;
3
4
4
5
use Neos \Cache \Frontend \StringFrontend ;
@@ -36,12 +37,15 @@ public function grabUncachedSegment(JoinPointInterface $joinPoint)
36
37
}
37
38
38
39
/**
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())")
40
44
* @param JoinPointInterface $joinPoint
41
45
*
42
46
* @throws \Neos\Utility\Exception\PropertyNotAccessibleException
43
47
*/
44
- public function interceptNodeCacheFlush (JoinPointInterface $ joinPoint )
48
+ public function interceptLegacyNodeCacheFlush (JoinPointInterface $ joinPoint )
45
49
{
46
50
$ object = $ joinPoint ->getProxy ();
47
51
@@ -50,6 +54,19 @@ public function interceptNodeCacheFlush(JoinPointInterface $joinPoint)
50
54
$ this ->cacheFrontend ->flushByTags ($ tags );
51
55
}
52
56
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
+
53
70
/**
54
71
* @return bool
55
72
*/
0 commit comments