[TASK] Cleanup configuration handling

This commit is contained in:
Philipp Dieter 2021-09-22 13:15:20 +02:00
parent 7c1dae9b5d
commit 57a4e34eb9
2 changed files with 8 additions and 39 deletions

View File

@ -204,9 +204,11 @@ class ActionController extends BaseController
*/
public function initializeAction()
{
$this->config = GeneralUtility::removeDotsFromTS(
$GLOBALS['TSFE']->config['config']
);
if ($GLOBALS['TSFE']->config['config']) {
$this->config = GeneralUtility::removeDotsFromTS(
$GLOBALS['TSFE']->config['config']
);
}
$this->pageType = GeneralUtility::_GP('type');
if (!is_numeric($this->pageType)) {
$this->pageType = 0;

View File

@ -19,18 +19,12 @@ use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
use TYPO3\CMS\Extbase\Object\ObjectManager;
use TYPO3\CMS\Extbase\Reflection\ClassSchema;
use TYPO3\CMS\Extbase\Reflection\ReflectionService;
use TYPO3\CMS\Frontend\Utility\EidUtility;
/**
* ValidationTrait
*/
trait DependencyInjectionTrait
{
/*
* extension Key
*/
protected $extensionKey = null;
/*
* storagePids
*/
@ -86,13 +80,9 @@ trait DependencyInjectionTrait
$this->objectManager = GeneralUtility::makeInstance(
ObjectManager::class
);
$this->initFrontendController();
$this->configurationManager = $this->objectManager->get(
ConfigurationManagerInterface::class
);
$this->configurationManager->setConfiguration(
array()
);
$this->apiUtility = $this->objectManager->get(
ApiUtility::class
);
@ -100,7 +90,9 @@ trait DependencyInjectionTrait
ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK,
$this->getExtensionKey()
);
$this->configurationManager->setConfiguration($frameworkConfiguration);
$this->configurationManager->setConfiguration(
$frameworkConfiguration
);
$this->settings = $frameworkConfiguration;
$this->storagePids = explode(
',',
@ -126,29 +118,4 @@ trait DependencyInjectionTrait
}
}
/**
* Initialize frontentController
*
* @return void
*/
private function initFrontendController()
{
$currentDomain = strtok(GeneralUtility::getIndpEnv('HTTP_HOST'), ':');
$frontendController = GeneralUtility::makeInstance(
\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::class,
$GLOBALS['TYPO3_CONF_VARS'],
null,
0,
true
);
$GLOBALS['TSFE'] = $frontendController;
$frontendController->connectToDB();
$frontendController->fe_user = EidUtility::initFeUser();
$frontendController->id = $result[0]['pid'];
$frontendController->determineId();
$frontendController->initTemplate();
$frontendController->getConfigArray();
EidUtility::initTCA();
}
}