[!!!][TASK] Do not clear caches after extension config change 80/31180/5
authorMarkus Klein <klein.t3@reelworx.at>
Thu, 11 Sep 2014 21:10:48 +0000 (23:10 +0200)
committerMarkus Klein <klein.t3@reelworx.at>
Mon, 3 Nov 2014 14:59:31 +0000 (15:59 +0100)
This change removes the cache flush after extension configuration changes.
Furthermore we avoid duplicate cache flushing on extension installation.

Resolves: #59966
Releases: master
Change-Id: I6b214ac76fb7305c40f0ce7a33b895323979cbe6
Reviewed-on: http://review.typo3.org/31180
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Stefan Froemken <froemken@gmail.com>
Tested-by: Stefan Froemken <froemken@gmail.com>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/core/Documentation/Changelog/master/Breaking-59966-ExtensionConfigurationCacheClearing.rst [new file with mode: 0644]
typo3/sysext/extensionmanager/Classes/Controller/ConfigurationController.php
typo3/sysext/extensionmanager/Classes/Utility/ConfigurationUtility.php

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-59966-ExtensionConfigurationCacheClearing.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-59966-ExtensionConfigurationCacheClearing.rst
new file mode 100644 (file)
index 0000000..f32a0a7
--- /dev/null
@@ -0,0 +1,27 @@
+=================================================================
+Breaking: #59966 - Extension Configuration cache-flushing changed
+=================================================================
+
+Description
+===========
+
+On saving the configuration of an extension, the system cache group has been flushed.
+This is inefficient as this includes also the classes cache, but most changes will
+never need this cache to be cleared.
+We optimize this for the common case and stop flushing caches after configuration changes completely.
+
+Impact
+======
+
+Extensions which relied on cache-clearing after configuration changes may require a manual cache flush.
+
+Affected installations
+======================
+
+Any installation that uses extensions relying on automatic cache flush after extension configuration changes.
+
+Migration
+=========
+
+Extensions requiring a cache flush after configuration changes need to implement a slot
+for the "afterExtensionConfigurationWrite" signal which allows individual cache flush actions.
index e00ddbf..cf28456 100644 (file)
@@ -45,25 +45,23 @@ class ConfigurationController extends AbstractController {
         * @return void
         */
        public function showConfigurationFormAction(array $extension) {
-               if (!array_key_exists('key', $extension)) {
-                       throw new ExtensionManagerException(
-                               'Extension key not found.',
-                               1359206803
-                       );
+               if (!isset($extension['key'])) {
+                       throw new ExtensionManagerException('Extension key not found.', 1359206803);
                }
-               $configuration = $this->configurationItemRepository->findByExtensionKey($extension['key']);
+               $extKey = $extension['key'];
+               $configuration = $this->configurationItemRepository->findByExtensionKey($extKey);
                if ($configuration) {
                        $this->view
                                ->assign('configuration', $configuration)
                                ->assign('extension', $extension);
                } else {
                        /** @var Extension $extension */
-                       $extension = $this->extensionRepository->findOneByCurrentVersionByExtensionKey($extension['key']);
+                       $extension = $this->extensionRepository->findOneByCurrentVersionByExtensionKey($extKey);
                        // Extension has no configuration and is a distribution
                        if ($extension->getCategory() === Extension::DISTRIBUTION_CATEGORY) {
                                $this->redirect('welcome', 'Distribution', NULL, array('extension' => $extension->getUid()));
                        }
-                       throw new ExtensionManagerException('The extension ' . htmlspecialchars($extension['key']) . ' has no configuration.');
+                       throw new ExtensionManagerException('The extension ' . $extKey . ' has no configuration.');
                }
        }
 
index cfb14f6..003407c 100644 (file)
@@ -13,6 +13,7 @@ namespace TYPO3\CMS\Extensionmanager\Utility;
  *
  * The TYPO3 project - inspiring people to share!
  */
+
 /**
  * Utility for dealing with ext_emconf and ext_conf_template settings
  *
@@ -58,7 +59,6 @@ class ConfigurationUtility implements \TYPO3\CMS\Core\SingletonInterface {
                /** @var $configurationManager \TYPO3\CMS\Core\Configuration\ConfigurationManager */
                $configurationManager = $this->objectManager->get('TYPO3\\CMS\\Core\\Configuration\\ConfigurationManager');
                $configurationManager->setLocalConfigurationValueByPath('EXT/extConf/' . $extensionKey, serialize($configuration));
-               \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Cache\\CacheManager')->flushCachesInGroup('system');
        }
 
        /**