[TASK] Update ckeditor to 4.13.0
[Packages/TYPO3.CMS.git] / typo3 / sysext / indexed_search / ext_localconf.php
1 <?php
2 defined('TYPO3_MODE') or die();
3
4 // register extbase plugin
5 \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
6 'IndexedSearch',
7 'Pi2',
8 [\TYPO3\CMS\IndexedSearch\Controller\SearchController::class => 'form,search,noTypoScript'],
9 [\TYPO3\CMS\IndexedSearch\Controller\SearchController::class => 'form,search']
10 );
11
12 // Attach to hooks:
13 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['pageIndexing'][] = \TYPO3\CMS\IndexedSearch\Indexer::class;
14 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['headerNoCache']['tx_indexedsearch'] = \TYPO3\CMS\IndexedSearch\Hook\TypoScriptFrontendHook::class . '->headerNoCache';
15 // Register with "crawler" extension:
16 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['crawler']['procInstructions']['indexed_search'] = [
17 'key' => 'tx_indexedsearch_reindex',
18 'value' => 'Re-indexing'
19 ];
20 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['crawler']['cli_hooks']['tx_indexedsearch_crawl'] = \TYPO3\CMS\IndexedSearch\Hook\CrawlerHook::class;
21 // Register with DataHandler:
22 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass']['tx_indexedsearch'] = \TYPO3\CMS\IndexedSearch\Hook\CrawlerHook::class;
23 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']['tx_indexedsearch'] = \TYPO3\CMS\IndexedSearch\Hook\CrawlerHook::class;
24 // Configure default document parsers:
25 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['external_parsers'] = [
26 'pdf' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
27 'doc' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
28 'docx' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
29 'dotx' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
30 'pps' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
31 'ppsx' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
32 'ppt' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
33 'pptx' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
34 'potx' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
35 'xls' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
36 'xlsx' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
37 'xltx' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
38 'sxc' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
39 'sxi' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
40 'sxw' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
41 'ods' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
42 'odp' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
43 'odt' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
44 'rtf' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
45 'txt' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
46 'html' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
47 'htm' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
48 'csv' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
49 'xml' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
50 'jpg' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
51 'jpeg' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
52 'tif' => \TYPO3\CMS\IndexedSearch\FileContentParser::class
53 ];
54
55 $extConf = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
56 \TYPO3\CMS\Core\Configuration\ExtensionConfiguration::class
57 )->get('indexed_search');
58
59 if (isset($extConf['useMysqlFulltext']) && (bool)$extConf['useMysqlFulltext']) {
60 // Use all index_* tables except "index_rel" and "index_words"
61 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['use_tables'] =
62 'index_phash,index_fulltext,index_section,index_grlist,index_stat_search,index_stat_word,index_debug,index_config';
63 // Register schema analyzer slot to hook in required fulltext index definition
64 $signalSlotDispatcher = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class);
65 $signalSlotDispatcher->connect(
66 'TYPO3\\CMS\\Install\\Service\\SqlExpectedSchemaService',
67 'tablesDefinitionIsBeingBuilt',
68 \TYPO3\CMS\IndexedSearch\Service\DatabaseSchemaService::class,
69 'addMysqlFulltextIndex'
70 );
71 unset($signalSlotDispatcher);
72 } else {
73 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['use_tables'] =
74 'index_phash,index_fulltext,index_rel,index_words,index_section,index_grlist,index_stat_search,index_stat_word,index_debug,index_config';
75 }
76
77 // Add search to new content element wizard
78 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('
79 mod.wizards.newContentElement.wizardItems.forms {
80 elements.search {
81 iconIdentifier = content-elements-searchform
82 title = LLL:EXT:indexed_search/Resources/Private/Language/locallang_pi.xlf:pi_wizard_title
83 description = LLL:EXT:indexed_search/Resources/Private/Language/locallang_pi.xlf:pi_wizard_description
84 tt_content_defValues {
85 CType = list
86 list_type = indexedsearch_pi2
87 }
88 }
89 show :=addToList(search)
90 }
91 ');
92
93 // Use the advanced doubleMetaphone parser instead of the internal one (usage of metaphone parsers is generally disabled by default)
94 if (isset($extConf['enableMetaphoneSearch']) && (int)$extConf['enableMetaphoneSearch'] == 2) {
95 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['metaphone'] = \TYPO3\CMS\IndexedSearch\Utility\DoubleMetaPhoneUtility::class;
96 }
97 unset($extConf);
98
99 if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class]['options']['tables'])) {
100 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class]['options']['tables']['index_stat_search'] = [
101 'dateField' => 'tstamp',
102 'expirePeriod' => 90
103 ];
104 }
105
106 if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\IpAnonymizationTask::class]['options']['tables'])) {
107 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\IpAnonymizationTask::class]['options']['tables']['index_stat_search'] = [
108 'dateField' => 'tstamp',
109 'ipField' => 'IP'
110 ];
111 }