‪TYPO3CMS  11.5
ext_localconf.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
14 
15 defined('TYPO3') or die();
16 
17 // register plugin
18 ‪ExtensionUtility::configurePlugin(
19  'IndexedSearch',
20  'Pi2',
21  [‪SearchController::class => 'form,search,noTypoScript'],
22  [‪SearchController::class => 'form,search']
23 );
24 
25 ‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-cached']['indexed_search'] = ‪TypoScriptFrontendHook::class . '->indexPageContent';
26 ‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc']['indexed_search'] = ‪DeleteIndexedData::class . '->delete';
27 
28 // Configure default document parsers:
29 ‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['external_parsers'] = [
30  'pdf' => ‪FileContentParser::class,
31  'doc' => ‪FileContentParser::class,
32  'docx' => ‪FileContentParser::class,
33  'dotx' => ‪FileContentParser::class,
34  'pps' => ‪FileContentParser::class,
35  'ppsx' => ‪FileContentParser::class,
36  'ppt' => ‪FileContentParser::class,
37  'pptx' => ‪FileContentParser::class,
38  'potx' => ‪FileContentParser::class,
39  'xls' => ‪FileContentParser::class,
40  'xlsx' => ‪FileContentParser::class,
41  'xltx' => ‪FileContentParser::class,
42  'sxc' => ‪FileContentParser::class,
43  'sxi' => ‪FileContentParser::class,
44  'sxw' => ‪FileContentParser::class,
45  'ods' => ‪FileContentParser::class,
46  'odp' => ‪FileContentParser::class,
47  'odt' => ‪FileContentParser::class,
48  'rtf' => ‪FileContentParser::class,
49  'txt' => ‪FileContentParser::class,
50  'html' => ‪FileContentParser::class,
51  'htm' => ‪FileContentParser::class,
52  'csv' => ‪FileContentParser::class,
53  'xml' => ‪FileContentParser::class,
54  'jpg' => ‪FileContentParser::class,
55  'jpeg' => ‪FileContentParser::class,
56  'tif' => ‪FileContentParser::class,
57 ];
58 
61 )->get('indexed_search');
62 
63 ‪if (isset(‪$extConf['useMysqlFulltext']) && (bool)‪$extConf['useMysqlFulltext']) {
64  // Use all index_* tables except "index_rel" and "index_words"
65  ‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['use_tables'] =
66  'index_phash,index_fulltext,index_section,index_grlist,index_stat_word,index_debug,index_config';
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_word,index_debug,index_config';
70 }
71 
72 // Add search to new content element wizard
73 ExtensionManagementUtility::addPageTSConfig('
74 mod.wizards.newContentElement.wizardItems.forms {
75  elements.search {
76  iconIdentifier = content-elements-searchform
77  title = LLL:EXT:indexed_search/Resources/Private/Language/locallang_db.xlf:plugin_title
78  description = LLL:EXT:indexed_search/Resources/Private/Language/locallang_db.xlf:plugin_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'] = DoubleMetaPhoneUtility::class;
91 }
92 unset(‪$extConf);
‪TYPO3\CMS\IndexedSearch\Controller\SearchController
Definition: SearchController.php:51
‪TYPO3\CMS\IndexedSearch\Utility\DoubleMetaPhoneUtility
Definition: DoubleMetaPhoneUtility.php:27
‪TYPO3\CMS\Core\Configuration\ExtensionConfiguration
Definition: ExtensionConfiguration.php:45
‪TYPO3\CMS\Extbase\Utility\ExtensionUtility
Definition: ExtensionUtility.php:29
‪TYPO3\CMS\IndexedSearch\Hook\DeleteIndexedData
Definition: DeleteIndexedData.php:28
‪TYPO3\CMS\Core\Utility\ExtensionManagementUtility
Definition: ExtensionManagementUtility.php:43
‪TYPO3\CMS\IndexedSearch\Hook\TypoScriptFrontendHook
Definition: TypoScriptFrontendHook.php:33
‪TYPO3\CMS\IndexedSearch\FileContentParser
Definition: FileContentParser.php:33
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪if
‪if(PHP_SAPI !=='cli')
Definition: checkNamespaceIntegrity.php:25
‪$extConf
‪$extConf
Definition: ext_localconf.php:59
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:50