getActivePackages(); // First load "full table" files from Configuration/TCA foreach ($activePackages as $package) { $tcaConfigurationDirectory = $package->getPackagePath() . 'Configuration/TCA'; if (is_dir($tcaConfigurationDirectory)) { $files = scandir($tcaConfigurationDirectory); foreach ($files as $file) { if (is_file($tcaConfigurationDirectory . '/' . $file) && ($file !== '.') && ($file !== '..') && (substr($file, -4, 4) === '.php') ) { $tcaOfTable = require $tcaConfigurationDirectory . '/' . $file; if (is_array($tcaOfTable)) { // TCA table name is filename without .php suffix, eg 'sys_notes', not 'sys_notes.php' $tcaTableName = substr($file, 0, -4); $GLOBALS['TCA'][$tcaTableName] = $tcaOfTable; } } } } } // Apply category stuff CategoryRegistry::getInstance()->applyTcaForPreRegisteredTables(); // Execute override files from Configuration/TCA/Overrides foreach ($activePackages 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; } } } } } /** * Load ext_tables.php of a single extension * * @param string $extensionKey The extension to load a ext_tables.php file from. */ public function loadSingleExtTablesFile(string $extensionKey) { global $T3_SERVICES, $T3_VAR, $TYPO3_CONF_VARS; global $TBE_MODULES, $TBE_MODULES_EXT, $TCA; global $PAGES_TYPES, $TBE_STYLES; global $_EXTKEY; $packageManager = GeneralUtility::makeInstance(PackageManager::class); try { $package = $packageManager->getPackage($extensionKey); } catch (\TYPO3\CMS\Core\Package\Exception\UnknownPackageException $e) { throw new \RuntimeException( 'Extension ' . $extensionKey . ' is not active', 1477217619 ); } $extTablesPath = $package->getPackagePath() . 'ext_tables.php'; // Load ext_tables.php file of the extension if (@file_exists($extTablesPath)) { // $_EXTKEY and $_EXTCONF are available in ext_tables.php // and are explicitly set in cached file as well $_EXTKEY = $extensionKey; $_EXTCONF = $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$_EXTKEY] ?? null; require $extTablesPath; } } }