[TASK] Change check for TYPO3_MODE
[Packages/TYPO3.CMS.git] / typo3 / sysext / indexed_search / ext_localconf.php
1 <?php
2 defined('TYPO3_MODE') or die();
3
4 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPItoST43($_EXTKEY);
5 \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin($_EXTKEY, 'Pi2', array('Search' => 'form,search'), array('Search' => 'form,search'));
6 // Attach to hooks:
7 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['pageIndexing'][] = 'TYPO3\\CMS\\IndexedSearch\\Indexer';
8 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['headerNoCache']['tx_indexedsearch'] = '&TYPO3\\CMS\\IndexedSearch\\Hook\\TypoScriptFrontendHook->headerNoCache';
9 // Register with "crawler" extension:
10 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['crawler']['procInstructions']['tx_indexedsearch_reindex'] = 'Re-indexing';
11 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['crawler']['cli_hooks']['tx_indexedsearch_crawl'] = '&TYPO3\\CMS\\IndexedSearch\\Hook\\CrawlerHook';
12 // Register with TCEmain:
13 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass']['tx_indexedsearch'] = '&TYPO3\\CMS\\IndexedSearch\\Hook\\CrawlerHook';
14 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']['tx_indexedsearch'] = '&TYPO3\\CMS\\IndexedSearch\\Hook\\CrawlerHook';
15 // Configure default document parsers:
16 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['external_parsers'] = array(
17 'pdf' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser',
18 'doc' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser',
19 'pps' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser',
20 'ppt' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser',
21 'xls' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser',
22 'sxc' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser',
23 'sxi' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser',
24 'sxw' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser',
25 'ods' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser',
26 'odp' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser',
27 'odt' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser',
28 'rtf' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser',
29 'txt' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser',
30 'html' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser',
31 'htm' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser',
32 'csv' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser',
33 'xml' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser',
34 'jpg' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser',
35 'jpeg' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser',
36 'tif' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser'
37 );
38 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['use_tables'] = 'index_phash,index_fulltext,index_rel,index_words,index_section,index_grlist,index_stat_search,index_stat_word,index_debug,index_config';
39 // unserializing the configuration so we can use it here:
40 $_EXTCONF = unserialize($_EXTCONF);
41 // Use the advanced doubleMetaphone parser instead of the internal one (usage of metaphone parsers is generally disabled by default)
42 if (isset($_EXTCONF['enableMetaphoneSearch']) && (int)$_EXTCONF['enableMetaphoneSearch'] == 2) {
43 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['metaphone'] = '&TYPO3\\CMS\\IndexedSearch\\Utility\\DoubleMetaPhoneUtility';
44 }