-
-
Notifications
You must be signed in to change notification settings - Fork 61
/
ext_localconf.php
113 lines (98 loc) · 4.88 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<?php
/*
* This file is part of the "headless" Extension for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.md file that was distributed with this source code.
*/
use FriendsOfTYPO3\Headless\Hooks\FileOrFolderLinkBuilder;
use FriendsOfTYPO3\Headless\Seo\MetaTag\EdgeMetaTagManager;
use FriendsOfTYPO3\Headless\Seo\MetaTag\Html5MetaTagManager;
use FriendsOfTYPO3\Headless\Seo\MetaTag\OpenGraphMetaTagManager;
use FriendsOfTYPO3\Headless\Seo\MetaTag\TwitterCardMetaTagManager;
use FriendsOfTYPO3\Headless\Resource\Rendering\AudioTagRenderer;
use FriendsOfTYPO3\Headless\Resource\Rendering\VideoTagRenderer;
use FriendsOfTYPO3\Headless\Resource\Rendering\VimeoRenderer;
use FriendsOfTYPO3\Headless\Resource\Rendering\YouTubeRenderer;
use FriendsOfTYPO3\Headless\Seo\CanonicalGenerator;
use FriendsOfTYPO3\Headless\XClass\ResourceLocalDriver;
use TYPO3\CMS\Core\Configuration\Features;
use TYPO3\CMS\Core\MetaTag\MetaTagManagerRegistry;
use TYPO3\CMS\Core\Resource\Driver\LocalDriver;
use TYPO3\CMS\Core\Resource\Rendering\RendererRegistry;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Service\ImageService;
use TYPO3\CMS\Form\Controller\FormFrontendController;
use TYPO3\CMS\Form\Domain\Runtime\FormRuntime;
use TYPO3\CMS\FrontendLogin\Controller\LoginController;
use TYPO3\CMS\Workspaces\Controller\PreviewController;
use TYPO3\CMS\Workspaces\Preview\PreviewUriBuilder;
defined('TYPO3') || die();
call_user_func(
static function () {
$GLOBALS['TYPO3_CONF_VARS']['FE']['contentRenderingTemplates'][] = 'headless/Configuration/TypoScript/';
$GLOBALS['TYPO3_CONF_VARS']['FE']['typolinkBuilder']['file'] = FileOrFolderLinkBuilder::class;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['fluid']['namespaces']['headless'] = [
'FriendsOfTYPO3\Headless\ViewHelpers'
];
$features = GeneralUtility::makeInstance(Features::class);
if ($features->isFeatureEnabled('headless.storageProxy')) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][LocalDriver::class] = [
'className' => ResourceLocalDriver::class
];
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][ImageService::class] = [
'className' => FriendsOfTYPO3\Headless\XClass\ImageService::class
];
}
if (ExtensionManagementUtility::isLoaded('form')) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][FormFrontendController::class] = [
'className' => FriendsOfTYPO3\Headless\XClass\Controller\FormFrontendController::class
];
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][FormRuntime::class] = [
'className' => FriendsOfTYPO3\Headless\XClass\FormRuntime::class
];
}
if (ExtensionManagementUtility::isLoaded('felogin')) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][LoginController::class] = [
'className' => FriendsOfTYPO3\Headless\XClass\Controller\LoginController::class
];
}
if (ExtensionManagementUtility::isLoaded('workspaces')) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][PreviewController::class] = [
'className' => FriendsOfTYPO3\Headless\XClass\Controller\PreviewController::class
];
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][PreviewUriBuilder::class] = [
'className' => FriendsOfTYPO3\Headless\XClass\Preview\PreviewUriBuilder::class
];
}
if (ExtensionManagementUtility::isLoaded('seo')) {
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['TYPO3\CMS\Frontend\Page\PageGenerator']['generateMetaTags']['canonical'] =
CanonicalGenerator::class . '->handle';
$metaTagManagerRegistry = GeneralUtility::makeInstance(MetaTagManagerRegistry::class);
$metaTagManagerRegistry->registerManager(
'html5',
Html5MetaTagManager::class
);
$metaTagManagerRegistry->registerManager(
'edge',
EdgeMetaTagManager::class
);
$metaTagManagerRegistry->registerManager(
'opengraph',
OpenGraphMetaTagManager::class
);
$metaTagManagerRegistry->registerManager(
'twitter',
TwitterCardMetaTagManager::class
);
unset($metaTagManagerRegistry);
}
$rendererRegistry = GeneralUtility::makeInstance(RendererRegistry::class);
$rendererRegistry->registerRendererClass(YouTubeRenderer::class);
$rendererRegistry->registerRendererClass(VimeoRenderer::class);
$rendererRegistry->registerRendererClass(AudioTagRenderer::class);
$rendererRegistry->registerRendererClass(VideoTagRenderer::class);
unset($rendererRegistry);
}
);