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