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