[FEATURE] Add hook to stdWrap_cacheStore
authorFabrizio Branca <mail@fabrizio-branca.de>
Mon, 27 Feb 2012 19:36:14 +0000 (20:36 +0100)
committerSteffen Ritter <info@rs-websystems.de>
Tue, 13 Mar 2012 08:57:03 +0000 (09:57 +0100)
In issue #34299 caching for stdWrap was introduced.

With this patch I'd like to add a hook to the cacheStore method.
Using this patch cache handling can be refined. usecases are
- reuse provided tags for page tags
- memorize lifetimes so that the pages lifetime can be limited
to the shortest stdWrap lifetime

Change-Id: I8faecc465c04810259b335a2cb30ec5a5a6ae52f
Resolves: #34343
Releases: 4.7, 4.6-backports, 4.5-backports
Reviewed-on: http://review.typo3.org/9264
Reviewed-by: Tolleiv Nietsch
Tested-by: Tolleiv Nietsch
Reviewed-by: Daniel Poetzinger
Tested-by: Daniel Poetzinger
Reviewed-by: Simon Schaufelberger
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
typo3/sysext/cms/tslib/class.tslib_content.php

index fcc85ed..fb6a223 100644 (file)
@@ -3171,6 +3171,18 @@ class tslib_cObj {
                                                $lifetime = NULL; // default lifetime
                                        }
 
+                                       if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['stdWrap_cacheStore'])) {
+                                               foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['stdWrap_cacheStore'] as $_funcRef) {
+                                                       $params = array(
+                                                               'key' => $conf['cache.']['key'],
+                                                               'content' => $content,
+                                                               'lifetime' => $lifetime,
+                                                               'tags' => $tags
+                                                       );
+                                                       t3lib_div::callUserFunction($_funcRef, $params, $this);
+                                               }
+                                       }
+
                                        $cacheFrontend->set(
                                                $conf['cache.']['key'],
                                                $content,