-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathext_localconf.php
50 lines (42 loc) · 2.45 KB
/
ext_localconf.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
declare(strict_types=1);
use PSB\PsbFoundation\Service\Configuration\PageTypeService;
use PSB\PsbFoundation\Service\Configuration\PluginService;
use PSB\PsbFoundation\Service\ExtensionInformationService;
use PSB\PsbFoundation\Service\GlobalVariableProviders\EarlyAccessConstantsProvider;
use PSB\PsbFoundation\Service\GlobalVariableProviders\RequestParameterProvider;
use PSB\PsbFoundation\Service\GlobalVariableProviders\SiteConfigurationProvider;
use PSB\PsbFoundation\Service\GlobalVariableService;
use PSB\PsbFoundation\Service\Typo3\LanguageServiceFactory;
use PSB\PsbFoundation\Utility\Configuration\FilePathUtility;
use PSB\PsbFoundation\Utility\FileUtility;
use TYPO3\CMS\Core\Localization\LanguageServiceFactory as Typo3LanguageServiceFactory;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
defined('TYPO3') or die();
(static function () {
// Overwrite LanguageServiceFactory to implement usage of plural forms in translations.
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][Typo3LanguageServiceFactory::class] = [
'className' => LanguageServiceFactory::class,
];
GlobalVariableService::registerGlobalVariableProvider(EarlyAccessConstantsProvider::class);
GlobalVariableService::registerGlobalVariableProvider(RequestParameterProvider::class);
GlobalVariableService::registerGlobalVariableProvider(SiteConfigurationProvider::class);
// configure all plugins of those extensions which provide an ExtensionInformation-class and add TypoScript if missing
$extensionInformationService = GeneralUtility::makeInstance(ExtensionInformationService::class);
$pageTypeService = GeneralUtility::makeInstance(PageTypeService::class);
$pluginService = GeneralUtility::makeInstance(PluginService::class);
foreach ($extensionInformationService->getAllExtensionInformation() as $extensionInformation) {
$pageTypeService->addToDragArea($extensionInformation);
$pluginService->configurePlugins($extensionInformation);
foreach ([
'user',
'User',
] as $filename) {
$userTsConfigFilename = FilePathUtility::EXTENSION_DIRECTORY_PREFIX . $extensionInformation->getExtensionKey() . '/Configuration/' . $filename . '.tsconfig';
if (FileUtility::fileExists($userTsConfigFilename)) {
ExtensionManagementUtility::addUserTSConfig('@import \'' . $userTsConfigFilename . '\'');
}
}
}
})();