forked from aaw-team/pagenotfoundhandling
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathext_localconf.php
More file actions
62 lines (57 loc) · 2.25 KB
/
Copy pathext_localconf.php
File metadata and controls
62 lines (57 loc) · 2.25 KB
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
<?php
/*
* Copyright by Agentur am Wasser | Maeder & Partner AG
*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
defined('TYPO3_MODE') or die();
$bootstrap = function(string $extKey) {
// register pageNotFound_handling
$GLOBALS['TYPO3_CONF_VARS']['FE']['pageNotFound_handling'] = 'USER_FUNCTION:AawTeam\\Pagenotfoundhandling\\Controller\\PagenotfoundController->main';
// Load extension configuration
if (version_compare(TYPO3_version, '9.0', '<')){
$extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$extKey], ['allowed_classes' => false]);
} else {
$extConf = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
\TYPO3\CMS\Core\Configuration\ExtensionConfiguration::class
)->get($extKey);
}
if (is_array($extConf)) {
// Register logger
if (array_key_exists('logLevel', $extConf)) {
$logLevel = (int)$extConf['logLevel'];
if ($logLevel > -1 && $logLevel < 8) {
$GLOBALS['TYPO3_CONF_VARS']['LOG']['AawTeam']['Pagenotfoundhandling']['writerConfiguration'] = [
$logLevel => [
\TYPO3\CMS\Core\Log\Writer\FileWriter::class => [
'logFileInfix' => 'pnfh',
],
],
];
}
}
// Add backend module configuration
if ($extConf['enableStatisticsModule']) {
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptSetup('
module.tx_pagenotfoundhandling {
view {
templateRootPaths.10 = EXT:pagenotfoundhandling/Resources/Private/Backend/Templates/
partialRootPaths.10 = EXT:pagenotfoundhandling/Resources/Private/Backend/Partials/
layoutRootPaths.10 = EXT:pagenotfoundhandling/Resources/Private/Backend/Layouts/
}
}'
);
}
}
};
$bootstrap($_EXTKEY);
unset($bootstrap);