packageManager->activatePackage($packageKey); $packages[$packageKey] = $this->packageManager->getPackage($packageKey); } // Load a new container as we are reloading ext_localconf.php files $container = $this->bootService->getContainer(); $backupContainer = $this->bootService->makeCurrent($container); // Reload cache files and Typo3LoadedExtensions $backupTca = $GLOBALS['TCA']; $container->get(CacheManager::class)->flushCaches(); $this->opcodeCacheService->clearAllActive(); $container->get(ExtLocalconfFactory::class)->loadUncached(); $tcaFactory = $container->get(TcaFactory::class); $GLOBALS['TCA'] = $tcaFactory->create(); $container->get(TcaSchemaFactory::class)->rebuild($GLOBALS['TCA']); // Set up packages $packageSetup = $container->get(PackageSetup::class); $packageSetup->setup($packages, true, $emitter, $container); // Reset to the original container instance and original TCA $GLOBALS['TCA'] = $backupTca; $this->bootService->makeCurrent(null, $backupContainer); } }