[FEATURE] Adding hook in flushByTag
authorFabrizio Branca <mail@fabrizio-branca.de>
Thu, 1 Mar 2012 23:23:45 +0000 (00:23 +0100)
committerSteffen Ritter <info@rs-websystems.de>
Tue, 13 Mar 2012 08:54:26 +0000 (09:54 +0100)
Cache tags could be reused for nc_staticfile cache or even for tagging
varnish cache content. When it is flushed using the caching framework
there should be a hook in place that allows to also purge other
external caches.

Change-Id: I39b85ca31722d66b9af1aeb76d248fc41dc360f6
Resolves: #34475
Releases: 4.8
Reviewed-on: http://review.typo3.org/9327
Reviewed-by: Tolleiv Nietsch
Tested-by: Tolleiv Nietsch
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
t3lib/cache/frontend/class.t3lib_cache_frontend_abstractfrontend.php

index 030c942..3e29156 100644 (file)
@@ -143,6 +143,13 @@ abstract class t3lib_cache_frontend_AbstractFrontend implements t3lib_cache_fron
                        );
                }
 
+               if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/cache/frontend/class.t3lib_cache_frontend_abstractfrontend.php']['flushByTag'])) {
+                       foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/cache/frontend/class.t3lib_cache_frontend_abstractfrontend.php']['flushByTag'] as $_funcRef) {
+                               $params = array('tag' => $tag);
+                               t3lib_div::callUserFunction($_funcRef, $params, $this);
+                       }
+               }
+
                $this->backend->flushByTag($tag);
        }