[BUGFIX] Re-enable the clearCacheForAllDomains == false functionality
authorBenjamin Franzke <bfr@qbus.de>
Sat, 26 Dec 2015 08:24:39 +0000 (09:24 +0100)
committerTim Lochm├╝ller <tim@fruit-lab.de>
Tue, 29 Dec 2015 09:12:37 +0000 (10:12 +0100)
Move the decision whether to clear the entire cache or only the current domain's
into StaticFileBackend::flush. Deciding into clearCachePostProc is not enough,
since StaticFileBackend::flush is additionally called directly through the DataHandler's
flush on the cache flush on the group 'pages'.

Classes/Cache/StaticFileBackend.php
Classes/StaticFileCache.php

index e395ed7..7954f06 100644 (file)
@@ -199,6 +199,10 @@ class StaticFileBackend extends AbstractBackend
      */
     public function flush()
     {
+        if ((boolean)$this->configuration->get('clearCacheForAllDomains') === false) {
+            $this->flushByTag('sfc_domain_' . str_replace('.', '_', GeneralUtility::getIndpEnv('TYPO3_HOST_ONLY')));
+            return;
+        }
         $absoluteCacheDir = GeneralUtility::getFileAbsFileName($this->cacheDirectory);
         if (is_dir($absoluteCacheDir)) {
             $tempAbsoluteCacheDir = rtrim($absoluteCacheDir, '/') . '_' . GeneralUtility::milliseconds() . '/';
index b4c17b6..cb017fa 100644 (file)
@@ -84,12 +84,7 @@ class StaticFileCache implements SingletonInterface
         switch ($params['cacheCmd']) {
             case 'all':
             case 'pages':
-                if ((boolean)$this->configuration->get('clearCacheForAllDomains')) {
-                    $this->cache->flush();
-                } else {
-                    $this->cache->flushByTag('domain_' . str_replace('.', '_',
-                            GeneralUtility::getIndpEnv('TYPO3_HOST_ONLY')));
-                }
+                $this->cache->flush();
                 break;
             default:
                 if (MathUtility::canBeInterpretedAsInteger($params['cacheCmd'])) {