[TASK] Cleanup cache clearing 73/47673/3
authorChristian Kuhn <lolli@schwarzbu.ch>
Thu, 14 Apr 2016 16:11:04 +0000 (18:11 +0200)
committerFrank Naegler <frank.naegler@typo3.org>
Thu, 14 Apr 2016 20:19:39 +0000 (22:19 +0200)
With change #75581 the backend toolbar cache handling the
"system" options are obsolete and can be deprecated.

Additionally, the label change is moved to an own label to
not clash with 7.6 and the now obsolete labels are deleted.

Change-Id: I666d73a97251beeddba78fba1940c0ea7fa29e58
Resolves: #75625
Related: #75581
Releases: master
Reviewed-on: https://review.typo3.org/47673
Reviewed-by: Helmut Hummel <helmut.hummel@typo3.org>
Reviewed-by: Benjamin Kott <info@bk2k.info>
Tested-by: Benjamin Kott <info@bk2k.info>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
typo3/sysext/backend/Classes/Backend/ToolbarItems/ClearCacheToolbarItem.php
typo3/sysext/core/Classes/DataHandling/DataHandler.php
typo3/sysext/core/Configuration/DefaultConfiguration.php
typo3/sysext/core/Documentation/Changelog/master/Deprecation-75625-DeprecatedCacheClearingOptions.rst [new file with mode: 0644]
typo3/sysext/install/Classes/Configuration/Context/CustomPreset.php
typo3/sysext/install/Classes/Configuration/Context/DebugPreset.php
typo3/sysext/install/Classes/Configuration/Context/LivePreset.php
typo3/sysext/install/Classes/Service/SilentConfigurationUpgradeService.php
typo3/sysext/lang/locallang_core.xlf

index 4faa057..24da0fa 100644 (file)
@@ -77,8 +77,8 @@ class ClearCacheToolbarItem implements ToolbarItemInterface
         ) {
             $this->cacheActions[] = array(
                 'id' => 'system',
-                'title' => htmlspecialchars($languageService->sL('LLL:EXT:lang/locallang_core.xlf:flushSystemCachesTitle')),
-                'description' => htmlspecialchars($languageService->sL('LLL:EXT:lang/locallang_core.xlf:flushSystemCachesDescription')),
+                'title' => htmlspecialchars($languageService->sL('LLL:EXT:lang/locallang_core.xlf:flushAllCachesTitle2')),
+                'description' => htmlspecialchars($languageService->sL('LLL:EXT:lang/locallang_core.xlf:flushAllCachesDescription2')),
                 'href' => BackendUtility::getModuleUrl('tce_db', ['vC' => $backendUser->veriCode(), 'cacheCmd' => 'all']),
                 'icon' => $this->iconFactory->getIcon('actions-system-cache-clear-impact-high', Icon::SIZE_SMALL)->render()
             );
index 323f67e..34cf327 100644 (file)
@@ -7812,8 +7812,6 @@ class DataHandler
                 break;
             case 'all':
                 if ($this->admin || $this->BE_USER->getTSConfigVal('options.clearCache.all')) {
-                    // Delete typo3temp/var/Cache manually as quick, straight and brutal approach here
-                    GeneralUtility::flushDirectory(PATH_site . 'typo3temp/var/Cache', true, true);
                     $this->getCacheManager()->flushCaches();
                     $this->databaseConnection->exec_TRUNCATEquery('cache_treelist');
                     // Delete Opcode Cache
@@ -7822,6 +7820,11 @@ class DataHandler
                 break;
             case 'temp_cached':
             case 'system':
+                GeneralUtility::deprecationLog(
+                    'Calling clear_cacheCmd() with arguments \'temp_cached\' or \'system\', using'
+                    . ' the ts config option \'options.clearCache.system\' or using'
+                    . '\'$GLOBALS[\'TYPO3_CONF_VARS\'][\'SYS\'][\'clearCacheSystem\'] has been deprecated.'
+                );
                 if ($this->admin || $this->BE_USER->getTSConfigVal('options.clearCache.system')
                     || ((bool)$GLOBALS['TYPO3_CONF_VARS']['SYS']['clearCacheSystem'] === true && $this->admin)) {
                     $this->getCacheManager()->flushCachesInGroup('system');
index 132a3d3..2fd8b99 100644 (file)
@@ -277,7 +277,6 @@ return array(
         'livesearch' => array(),    // Array: keywords used for commands to search for specific tables
         'isInitialInstallationInProgress' => false,        // Boolean: If TRUE, the installation is 'in progress'. This value is handled within the install tool step installer internally.
         'isInitialDatabaseImportDone' => true,        // Boolean: If TRUE, the database import is finished. This value is handled within the install tool step installer internally.
-        'clearCacheSystem' => false,        // Boolean: If set, the toolbar menu entry for clearing system caches (core cache, class cache, etc.) is visible for admin users.
         'formEngine' => array(
             'nodeRegistry' => array(), // Array: Registry to add or overwrite FormEngine nodes. Main key is a timestamp of the date when an entry is added, sub keys type, priority and class are required. Class must implement TYPO3\CMS\Backend\Form\NodeInterface.
             'nodeResolver' => array(), // Array: Additional node resolver. Main key is a timestamp of the date when an entry is added, sub keys type, priority and class are required. Class must implement TYPO3\CMS\Backend\Form\NodeResolverInterface.
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-75625-DeprecatedCacheClearingOptions.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-75625-DeprecatedCacheClearingOptions.rst
new file mode 100644 (file)
index 0000000..4738673
--- /dev/null
@@ -0,0 +1,31 @@
+=======================================================
+Deprecation: #75625 - Deprecated cache clearing options
+=======================================================
+
+Description
+===========
+
+The following commands have been deprecated and should not be used anymore:
+
+* Method :php:`DataHandler->clear_cacheCmd()` with arguments `system` and `temp_cached`
+* ``userTSconfig`` setting ``options.clearCache.system``
+* Option ``$TYPO3_CONF_VARS['SYS']['clearCacheSystem']``
+
+
+Impact
+======
+
+Directly or indirectly using method ``clear_cacheCmd`` with these arguments will trigger a deprecation log entry.
+
+
+Affected Installations
+======================
+
+All installations with third party extensions using this method are affected.
+
+
+Migration
+=========
+
+If the group of system caches needs to be deleted explicitely, use :php:`flushCachesInGroup('system')`
+of ``CacheManager`` directly.
\ No newline at end of file
index 6e6e34e..28a478a 100644 (file)
@@ -32,6 +32,5 @@ class CustomPreset extends Configuration\AbstractCustomPreset implements Configu
         'SYS/enableDeprecationLog' => '',
         'SYS/sqlDebug' => '',
         'SYS/systemLogLevel' => '',
-        'SYS/clearCacheSystem' => '',
     );
 }
index a328859..97192f0 100644 (file)
@@ -44,7 +44,6 @@ class DebugPreset extends Configuration\AbstractPreset
         'SYS/systemLogLevel' => 0,
         // E_WARNING | E_RECOVERABLE_ERROR | E_DEPRECATED | E_USER_DEPRECATED
         'SYS/exceptionalErrors' => 28674,
-        'SYS/clearCacheSystem' => true,
     );
 
     /**
index fe0c763..5c5b7f5 100644 (file)
@@ -42,7 +42,6 @@ class LivePreset extends Configuration\AbstractPreset
         'SYS/enableDeprecationLog' => false,
         'SYS/sqlDebug' => 0,
         'SYS/systemLogLevel' => 2,
-        'SYS/clearCacheSystem' => false,
     );
 
     /**
index cd6eb7c..7368da2 100755 (executable)
@@ -96,7 +96,9 @@ class SilentConfigurationUpgradeService
         'SYS/curlTimeout',
         // #75355
         'BE/niceFlexFormXMLtags',
-        'BE/compactFlexFormXML'
+        'BE/compactFlexFormXML',
+        // #75625
+        'SYS/clearCacheSystem',
     ];
 
     public function __construct(ConfigurationManager $configurationManager = null)
index 1a1650c..baafd23 100644 (file)
@@ -863,23 +863,11 @@ Do you want to refresh it now?</source>
                        <trans-unit id="flushPageCachesDescription">
                                <source>Clear frontend and page-related caches.</source>
                        </trans-unit>
-                       <trans-unit id="flushAllCachesTitle">
+                       <trans-unit id="flushAllCachesTitle2">
                                <source>Flush all caches</source>
                        </trans-unit>
-                       <trans-unit id="flushAllCachesDescription">
-                               <source>Clear all caches, including frontend caches, and extension-specific caches. Compile-time caches / system caches that are needed for TYPO3 to run are not touched.</source>
-                       </trans-unit>
-                       <trans-unit id="flushGeneralCachesTitle">
-                               <source>Flush general caches</source>
-                       </trans-unit>
-                       <trans-unit id="flushGeneralCachesDescription">
-                               <source>Clear frontend and page-related caches, plus some backend-related caches.</source>
-                       </trans-unit>
-                       <trans-unit id="flushSystemCachesTitle">
-                               <source>Flush all caches</source>
-                       </trans-unit>
-                       <trans-unit id="flushSystemCachesDescription">
-                               <source>Clear all system-related caches, including the class loader, localization, extension configuration file caches and opcode caches. Rebuilding this cache may take some time.</source>
+                       <trans-unit id="flushAllCachesDescription2">
+                               <source>Clear all system-related caches, including localization, extension configuration, file caches and opcode caches. Rebuilding this cache may take some time.</source>
                        </trans-unit>
                        <trans-unit id="rm.adminFunctions">
                                <source>Admin functions</source>