[TASK] Make driver registry TCA change cacheable 04/48204/2
authorHelmut Hummel <info@helhum.io>
Mon, 9 May 2016 17:54:04 +0000 (19:54 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Wed, 18 May 2016 07:29:51 +0000 (09:29 +0200)
Instead of calling the driver registry on every request,
we can cache the TCA addition, by putting the call into overrides.

Resolves: #76102
Releases: 7.6, master
Change-Id: I8cfc72f0e7dbb133eecc754fd3cb774637a0d4bf
Reviewed-on: https://review.typo3.org/48204
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/core/Classes/Resource/Driver/DriverRegistry.php
typo3/sysext/core/Configuration/TCA/Overrides/sys_file_storage.php [new file with mode: 0644]
typo3/sysext/core/ext_tables.php

index 6679b50..23065c8 100644 (file)
@@ -87,10 +87,6 @@ class DriverRegistry implements \TYPO3\CMS\Core\SingletonInterface
      */
     public function addDriversToTCA()
     {
-        // Add driver to TCA of sys_file_storage
-        if (TYPO3_MODE !== 'BE') {
-            return;
-        }
         $driverFieldConfig = &$GLOBALS['TCA']['sys_file_storage']['columns']['driver']['config'];
         $configurationFieldConfig = &$GLOBALS['TCA']['sys_file_storage']['columns']['configuration']['config'];
         foreach ($this->driverConfigurations as $driver) {
diff --git a/typo3/sysext/core/Configuration/TCA/Overrides/sys_file_storage.php b/typo3/sysext/core/Configuration/TCA/Overrides/sys_file_storage.php
new file mode 100644 (file)
index 0000000..4404f35
--- /dev/null
@@ -0,0 +1,4 @@
+<?php
+defined('TYPO3_MODE') || die();
+
+\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Resource\Driver\DriverRegistry::class)->addDriversToTCA();
index 8788f36..2405323 100644 (file)
@@ -40,10 +40,6 @@ $GLOBALS['PAGES_TYPES'] = array(
 
 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('sys_category,sys_file_reference,sys_file_collection');
 
-/** @var \TYPO3\CMS\Core\Resource\Driver\DriverRegistry $registry */
-$registry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Resource\Driver\DriverRegistry::class);
-$registry->addDriversToTCA();
-
 /**
  * $TBE_MODULES contains the structure of the backend modules as they are
  * arranged in main- and sub-modules. Every entry in this array represents a