[TASK] Remove TCA building aspect and move code to bootstrap 34/31234/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Sat, 21 Jun 2014 16:25:04 +0000 (18:25 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Sun, 29 Jun 2014 20:49:33 +0000 (22:49 +0200)
The patch moves the slot code that implements the override loading
logic back to the bootstrap but keeps the signal.

Resolves: #59770
Related: #59414
Related: #59468
Releases: 6.3, 6.2
Change-Id: Ib4691eaa94f258ebd96f2609fb267cadc8356090
Reviewed-on: https://review.typo3.org/31234
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
typo3/sysext/core/Classes/Configuration/TcaBuildingAspect.php [deleted file]
typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php
typo3/sysext/core/ext_localconf.php

diff --git a/typo3/sysext/core/Classes/Configuration/TcaBuildingAspect.php b/typo3/sysext/core/Classes/Configuration/TcaBuildingAspect.php
deleted file mode 100644 (file)
index 7cab5d0..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-<?php
-namespace TYPO3\CMS\Core\Configuration;
-
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-/**
- * Assembles TCA overrides from packages to build the final TCA
- */
-class TcaBuildingAspect {
-
-       const TCA_OVERRIDES_PATH = 'Configuration/TCA/Overrides';
-
-       /**
-        * @var \TYPO3\CMS\Core\Package\PackageManager
-        * @inject
-        */
-       protected $packageManager;
-
-       /**
-        * @var \TYPO3\CMS\Core\Category\CategoryRegistry
-        * @inject
-        */
-       protected $categoryRegistry;
-
-       /**
-        * Scans active packages for TCA override code and executes it.
-        * Also applies category registry changes after that, so that
-        * registering calls to the registry can be (and should be) in TCA override files.
-        *
-        * @return array
-        */
-       public function applyTcaOverrides() {
-               $this->categoryRegistry->applyTcaForPreRegisteredTables();
-               foreach ($this->packageManager->getActivePackages() as $package) {
-                       $tcaOverridesPathForPackage = $package->getPackagePath() . self::TCA_OVERRIDES_PATH;
-                       if (is_dir($tcaOverridesPathForPackage)) {
-                               $files = scandir($tcaOverridesPathForPackage);
-                               foreach ($files as $file) {
-                                       if (
-                                               is_file($tcaOverridesPathForPackage . '/' . $file)
-                                               && ($file !== '.')
-                                               && ($file !== '..')
-                                               && (substr($file, -4, 4) === '.php')
-                                       ) {
-                                               require($tcaOverridesPathForPackage . '/' . $file);
-                                       }
-                               }
-                       }
-
-               }
-               return array($GLOBALS['TCA']);
-       }
-}
\ No newline at end of file
index d7860c9..00507f6 100644 (file)
@@ -1614,6 +1614,8 @@ tt_content.' . $key . $prefix . ' {
         */
        static protected function buildBaseTcaFromSingleFiles() {
                $GLOBALS['TCA'] = array();
+
+               // First load "full table" files from Configuration/TCA
                foreach (self::getLoadedExtensionListArray() as $extensionName) {
                        $tcaConfigurationDirectory = self::extPath($extensionName) . 'Configuration/TCA';
                        if (is_dir($tcaConfigurationDirectory)) {
@@ -1636,6 +1638,27 @@ tt_content.' . $key . $prefix . ' {
                        }
                }
 
+               // Apply category stuff
+               \TYPO3\CMS\Core\Category\CategoryRegistry::getInstance()->applyTcaForPreRegisteredTables();
+
+               // Execute override files from Configuration/TCA/Overrides
+               foreach (static::$packageManager->getActivePackages() as $package) {
+                       $tcaOverridesPathForPackage = $package->getPackagePath() . 'Configuration/TCA/Overrides';
+                       if (is_dir($tcaOverridesPathForPackage)) {
+                               $files = scandir($tcaOverridesPathForPackage);
+                               foreach ($files as $file) {
+                                       if (
+                                               is_file($tcaOverridesPathForPackage . '/' . $file)
+                                               && ($file !== '.')
+                                               && ($file !== '..')
+                                               && (substr($file, -4, 4) === '.php')
+                                       ) {
+                                               require($tcaOverridesPathForPackage . '/' . $file);
+                                       }
+                               }
+                       }
+               }
+
                static::emitTcaIsBeingBuiltSignal($GLOBALS['TCA']);
        }
 
index 29f2b60..828d6b8 100644 (file)
@@ -27,13 +27,6 @@ $signalSlotDispatcher->connect(
        'removeFromRepository'
 );
 
-$signalSlotDispatcher->connect(
-       'TYPO3\\CMS\\Core\\Utility\\ExtensionManagementUtility',
-       'tcaIsBeingBuilt',
-       'TYPO3\\CMS\\Core\\Configuration\\TcaBuildingAspect',
-       'applyTcaOverrides'
-);
-
 unset($signalSlotDispatcher);
 
 $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['dumpFile'] = 'EXT:core/Resources/PHP/FileDumpEID.php';