Usage of $GLOBALS['typo3CacheManager'] and $GLOBALS['typo3CacheFactory'] are deprecat...
[TYPO3CMS/Extensions/static_info_tables.git] / ext_localconf.php
1 <?php
2 if (!defined ('TYPO3_MODE')) {
3 die ('Access denied.');
4 }
5
6 if (!defined ('STATIC_INFO_TABLES_EXTkey')) {
7 define('STATIC_INFO_TABLES_EXTkey', $_EXTKEY);
8 }
9
10 if (!defined ('PATH_BE_staticinfotables')) {
11 define('PATH_BE_staticinfotables', \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY));
12 }
13
14 if (!defined ('PATH_BE_staticinfotables_rel')) {
15 define('PATH_BE_staticinfotables_rel', \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($_EXTKEY));
16 }
17 // Unserializing the configuration so we can use it here
18 $_EXTCONF = unserialize($_EXTCONF);
19
20 // Including Extbase configuration
21 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptSetup('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:' . $_EXTKEY . '/Configuration/TypoScript/Extbase/setup.txt">');
22
23 // Register cache static_info_tables
24 if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][$_EXTKEY])) {
25 $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][$_EXTKEY] = array();
26 $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][$_EXTKEY]['groups'] = array('all');
27 }
28 if (!isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][$_EXTKEY]['frontend'])) {
29 $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][$_EXTKEY]['frontend'] = 'TYPO3\\CMS\\Core\\Cache\\Frontend\\PhpFrontend';
30 }
31 if (!isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][$_EXTKEY]['backend'])) {
32 $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][$_EXTKEY]['backend'] = 'TYPO3\\CMS\\Core\\Cache\\Backend\\FileBackend';
33 }
34
35 // Configure clear cache post processing for extended domain model
36 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc'][$_EXTKEY] = 'EXT:' . $_EXTKEY . '/Classes/Cache/ClassCacheManager.php:SJBR\StaticInfoTables\Cache\ClassCacheManager->reBuild';
37
38 // Names of static entities
39 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$_EXTKEY]['entities'] = array(
40 'Country',
41 'CountryZone',
42 'Currency',
43 'Language',
44 'Territory'
45 );
46
47 // Register cached domain model classes autoloader
48 require_once(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Classes/Cache/CachedClassLoader.php');
49 \SJBR\StaticInfoTables\Cache\CachedClassLoader::registerAutoloader();
50
51 // Possible label fields for different languages. Default as last.
52 $labelTable = array(
53 'static_territories' => array(
54 'label_fields' => array(
55 'tr_name_##', 'tr_name_en',
56 ),
57 'isocode_field' => array(
58 'tr_iso_##',
59 ),
60 ),
61 'static_countries' => array(
62 'label_fields' => array(
63 'cn_short_##', 'cn_short_en',
64 ),
65 'isocode_field' => array(
66 'cn_iso_##',
67 ),
68 ),
69 'static_country_zones' => array(
70 'label_fields' => array(
71 'zn_name_##', 'zn_name_local',
72 ),
73 'isocode_field' => array(
74 'zn_code', 'zn_country_iso_##',
75 ),
76 ),
77 'static_languages' => array(
78 'label_fields' => array(
79 'lg_name_##', 'lg_name_en',
80 ),
81 'isocode_field' => array(
82 'lg_iso_##', 'lg_country_iso_##',
83 ),
84 ),
85 'static_currencies' => array(
86 'label_fields' => array(
87 'cu_name_##', 'cu_name_en',
88 ),
89 'isocode_field' => array(
90 'cu_iso_##',
91 ),
92 ),
93 );
94
95 if (isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$_EXTKEY]['tables']) && is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$_EXTKEY]['tables'])) {
96 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$_EXTKEY]['tables'] = array_merge($labelTable, $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$_EXTKEY]['tables']);
97 } else {
98 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$_EXTKEY]['tables'] = $labelTable;
99 }
100 unset($labelTable);
101
102 // Registering backend form select field prrenderingfor hook in order to localize selected items
103 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tceforms.php']['getSingleFieldClass'][] = 'SJBR\\StaticInfoTables\\Hook\\Backend\\Form\\ElementRenderingHelper';
104
105 // Add data handling hook to manage ISO codes redundancies on records
106 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][] = 'SJBR\\StaticInfoTables\\Hook\\Core\\DataHandling\\ProcessDataMap';
107
108 // Enabling the Static Info Tables Manager module
109 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$_EXTKEY]['enableManager'] = isset($_EXTCONF['enableManager']) ? $_EXTCONF['enableManager'] : '0';
110
111 // Make the extension version and constraints available when creating language packs and to other extensions
112 require_once(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'ext_emconf.php');
113 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$_EXTKEY]['version'] = $EM_CONF[$_EXTKEY]['version'];
114 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$_EXTKEY]['constraints'] = $EM_CONF[$_EXTKEY]['constraints'];