-
Notifications
You must be signed in to change notification settings - Fork 0
/
ext_localconf.php
225 lines (186 loc) · 10.9 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
<?php
defined('TYPO3_MODE') || die('Access denied.');
$extConf = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Configuration\ExtensionConfiguration::class)->get('vierwd_base');
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['vierwd_base'] = ['paths' => []];
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\EBT\ExtensionBuilder\Service\FileGenerator::class] = [
'className' => \Vierwd\VierwdBase\ExtensionBuilder\Service\FileGenerator::class,
];
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\EBT\ExtensionBuilder\Service\Printer::class] = [
'className' => Vierwd\VierwdBase\ExtensionBuilder\Service\Printer::class,
];
// ***************
// minify JS hook
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_div.php']['minifyJavaScript'][] = \Vierwd\VierwdBase\Hooks\JavascriptOptimization::class . '->jsMinify';
$GLOBALS['TYPO3_CONF_VARS']['FE']['jsCompressHandler'] = \Vierwd\VierwdBase\Hooks\JavascriptOptimization::class . '->jsCompressHandler';
// ***************
// 404-PageNotFoundHandling
$GLOBALS['TYPO3_CONF_VARS']['FE']['pageNotFound_handling'] = 'USER_FUNCTION:' . \Vierwd\VierwdBase\Hooks\PageNotFoundHandler::class . '->pageNotFound';
// Disable lockIP, if the server is requesting the 404-page
$GLOBALS['TYPO3_CONF_VARS']['FE']['lockIP'] = $_SERVER['SERVER_ADDR'] && $_SERVER['SERVER_ADDR'] == \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REMOTE_ADDR') ? false : $GLOBALS['TYPO3_CONF_VARS']['FE']['lockIP'];
// ***************
// BackendLayoutDataProvider
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['BackendLayoutDataProvider']['vierwd_base'] = \Vierwd\VierwdBase\Backend\BackendLayoutDataProvider::class;
// disable html_errors, if this is an ajax request
if (!empty($_SERVER['HTTP_X_REQUESTED_WITH'])) {
ini_set('html_errors', 'off');
}
// **************
// Add cache-buster to all publicURLs
$signalSlotDispatcher = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class);
$signalSlotDispatcher->connect(\TYPO3\CMS\Core\Resource\ResourceStorage::class, \TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PreGeneratePublicUrl, \Vierwd\VierwdBase\Resource\CacheBuster::class, 'getPublicUrl');
// **************
// Check for duplicte files after upload
$signalSlotDispatcher->connect(\TYPO3\CMS\Core\Resource\ResourceStorage::class, \TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PostFileAdd, \Vierwd\VierwdBase\Resource\DuplicateFiles::class, 'checkForDuplicateFiles');
// **************
// Replace encoded mail addresses during indexing
if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('indexed_search')) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\TYPO3\CMS\IndexedSearch\Indexer::class] = [
'className' => \Vierwd\VierwdBase\XClass\IndexedSearch\Indexer::class,
];
// ***************
// Indexing Hook in TSFE is too early. It happens before Meta-Tags are replaced and title is generated
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['pageIndexing'])) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['pageIndexing'] as $hookClass) {
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-output'][$hookClass] = function($params, $tsfe) use ($hookClass) {
$_procObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance($hookClass);
$_procObj->hook_indexContent($tsfe);
};
}
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['pageIndexing'] = [];
unset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['isOutputting']['tx_crawler']);
}
}
// ****************
// Force progressive jpegs
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\TYPO3\CMS\Core\Imaging\GraphicalFunctions::class] = [
'className' => \Vierwd\VierwdBase\Imaging\GraphicalFunctions::class,
];
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\TYPO3\CMS\Frontend\Imaging\GifBuilder::class] = [
'className' => \Vierwd\VierwdBase\Imaging\GifBuilder::class,
];
// ****************
// X-Class for SVGContentObject
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\TYPO3\CMS\Frontend\ContentObject\ScalableVectorGraphicsContentObject::class] = [
'className' => \Vierwd\VierwdBase\Frontend\ContentObject\ScalableVectorGraphicsContentObject::class,
];
// **************
// Filter files/folders
$GLOBALS['TYPO3_CONF_VARS']['SYS']['fal']['defaultFilterCallbacks'][] = [\Vierwd\VierwdBase\Resource\FilterFiles::class, 'filterFilesCallback'];
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\TYPO3\CMS\Core\Resource\Driver\LocalDriver::class] = [
'className' => \Vierwd\VierwdBase\Resource\LocalDriver::class,
];
// **************
// Make save-and-close the default action
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['Backend\Template\Components\ButtonBar']['getButtonsHook'][] = \Vierwd\VierwdBase\Backend\GetButtonsHook::class . '->adjustSaveAndClose';
// **************
// Improve handling of parallel requests
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['pageLoadedFromCache'][] = \Vierwd\VierwdBase\Frontend\PageLoadedFromCache::class . '->stallTempPage';
// **************
// Fix incorrect umlauts during editing of data
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][] = \Vierwd\VierwdBase\Hooks\DataHandler::class;
// **************
// Hyphenate words in generated html
if ($extConf['cachedPostprocessing']) {
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-all']['tx_vierwd'] = \Vierwd\VierwdBase\Hooks\Utility::class . '->postProcessHTML';
} else {
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_eofe']['tx_vierwd'] = \Vierwd\VierwdBase\Hooks\Utility::class . '->postProcessHTML';
}
// *****************
// Warn when no editor has access to edit some content elements
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['displayWarningMessages'][] = \Vierwd\VierwdBase\Hooks\CheckBackendGroups::class;
// Database connection with correct utf8mb4 charset
$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['tableoptions'] = [
'charset' => 'utf8mb4',
'collate' => 'utf8mb4_unicode_ci',
];
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['formDataGroup']['tcaDatabaseRecord'][\Vierwd\VierwdBase\Form\FormDataProvider\RichtextConfiguration::class] = [
'depends' => [
\TYPO3\CMS\Backend\Form\FormDataProvider\TcaText::class,
],
];
// ***************
// Add custom content Elements. Configure in Configuration/FCE/*.php
\Vierwd\VierwdBase\Hooks\ContentElements::addFCEs('vierwd_base', true);
if (!empty($extConf['forceMyISAM'])) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\TYPO3\CMS\Core\Database\Schema\SqlReader::class] = [
'className' => \Vierwd\VierwdBase\Database\ForceMyISAM::class,
];
}
// Add Hook for Import/Export which imports the groupid for pages.
// By default groupid for pages would be set to the group of the current user.
// During initial import, our "All users"-group does not exist yet and will be generated
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/impexp/class.tx_impexp.php']['before_setRelation']['vierwd_base'] = \Vierwd\VierwdBase\Hooks\ImportExport::class . '->before_setRelation';
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/impexp/class.tx_impexp.php']['before_writeRecordsPages']['vierwd_base'] = \Vierwd\VierwdBase\Hooks\ImportExport::class . '->before_writeRecordsPages';
// ***************
// Add HotspotEditor
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1536673649] = [
'nodeName' => 'vierwdHotspot',
'priority' => '70',
'class' => \Vierwd\VierwdBase\Form\Element\HotspotEditorElement::class,
];
// Add gridelement types to PageTsConfig (tt_content.gridtypes.container.section_frame.addItems...)
if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('gridelements')) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['formDataGroup']['tcaDatabaseRecord'][\Vierwd\VierwdBase\Form\FormDataProvider\GridelementsContainerTypeValue::class] = [
'depends' => [
\TYPO3\CMS\Backend\Form\FormDataProvider\DatabaseRecordTypeValue::class,
],
'before' => [
\TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems::class,
],
];
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['formDataGroup']['tcaDatabaseRecord'][\Vierwd\VierwdBase\Form\FormDataProvider\GridelementsMergeTsConfig::class] = [
'depends' => [
\Vierwd\VierwdBase\Form\FormDataProvider\GridelementsContainerTypeValue::class,
\TYPO3\CMS\Backend\Form\FormDataProvider\PageTsConfigMerged::class,
],
'before' => [
\TYPO3\CMS\Backend\Form\FormDataProvider\TcaColumnsOverrides::class,
\TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems::class,
],
];
}
// Remove canonical URL generation and hreflang generation from TYPO3 seo extension.
// The generated links might contain malicous query strings.
// @see https://forge.typo3.org/issues/87105
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][\TYPO3\CMS\Frontend\Page\PageGenerator::class]['generateMetaTags'])) {
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][\TYPO3\CMS\Frontend\Page\PageGenerator::class]['generateMetaTags'] = array_filter($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][\TYPO3\CMS\Frontend\Page\PageGenerator::class]['generateMetaTags'], function($method) {
return !in_array($method, [\TYPO3\CMS\Seo\HrefLang\HrefLangGenerator::class . '->generate', \TYPO3\CMS\Seo\Canonical\CanonicalGenerator::class . '->generate']);
});
}
if (!empty($_SERVER['VIERWD_CONFIG'])) {
// *****************************
// disable https on dev-machines
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getPageOverlay'][] = \Vierwd\VierwdBase\Hooks\NoHttps::class;
// **************
// Allow Shift-Reload even without admin login in local context
if (!empty($_SERVER['HTTP_CACHE_CONTROL']) && strtolower($_SERVER['HTTP_CACHE_CONTROL']) === 'no-cache') {
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['headerNoCache'][] = function($params) {
$params['disableAcquireCacheData'] = true;
};
}
// **************
// Force case-sensitive file systems
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\TYPO3\CMS\Core\Resource\StorageRepository::class] = [
'className' => \Vierwd\VierwdBase\XClass\Core\Resource\StorageRepository::class,
];
// Log Deprecations
\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($GLOBALS['TYPO3_CONF_VARS'], [
'LOG' => [
'TYPO3' => [
'CMS' => [
'deprecations' => [
'writerConfiguration' => [
\TYPO3\CMS\Core\Log\LogLevel::NOTICE => [
\Vierwd\VierwdBase\Log\Writer\DeprecationWriter::class => [],
],
],
],
],
],
],
]);
}
$GLOBALS['TYPO3_CONF_VARS']['SYS']['routing']['aspects']['AutomaticSlugPatternMapper'] = \Vierwd\VierwdBase\Routing\Aspect\AutomaticSlugPatternMapper::class;
// Setup Plugins directoy
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['vierwd_smarty']['pluginDirs'][] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('vierwd_base', 'Resources/Private/Smarty');
unset($extConf);