[TASK] Clean up buildBaseTcaFromSingleFiles() 60/31360/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Sat, 5 Jul 2014 16:07:17 +0000 (18:07 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Sat, 5 Jul 2014 17:21:24 +0000 (19:21 +0200)
The method uses two different approaches to get a list of active
packages, this is cleaned up to use the package manager only.

Change-Id: Ifc73d36ed0020914b0f7cf0b479010f91d1eba7f
Resolves: #60121
Related: #60120
Related: #59770
Releases: 6.3, 6.2
Reviewed-on: https://review.typo3.org/31360
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php

index 39d0fe2..d212012 100644 (file)
@@ -1615,9 +1615,11 @@ tt_content.' . $key . $prefix . ' {
        static protected function buildBaseTcaFromSingleFiles() {
                $GLOBALS['TCA'] = array();
 
+               $activePackages = static::$packageManager->getActivePackages();
+
                // First load "full table" files from Configuration/TCA
-               foreach (self::getLoadedExtensionListArray() as $extensionName) {
-                       $tcaConfigurationDirectory = self::extPath($extensionName) . 'Configuration/TCA';
+               foreach ($activePackages as $package) {
+                       $tcaConfigurationDirectory = $package->getPackagePath() . 'Configuration/TCA';
                        if (is_dir($tcaConfigurationDirectory)) {
                                $files = scandir($tcaConfigurationDirectory);
                                foreach ($files as $file) {
@@ -1642,7 +1644,7 @@ tt_content.' . $key . $prefix . ' {
                \TYPO3\CMS\Core\Category\CategoryRegistry::getInstance()->applyTcaForPreRegisteredTables();
 
                // Execute override files from Configuration/TCA/Overrides
-               foreach (static::$packageManager->getActivePackages() as $package) {
+               foreach ($activePackages as $package) {
                        $tcaOverridesPathForPackage = $package->getPackagePath() . 'Configuration/TCA/Overrides';
                        if (is_dir($tcaOverridesPathForPackage)) {
                                $files = scandir($tcaOverridesPathForPackage);