forked from TYPO3-Solr/ext-tika
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ext_localconf.php
36 lines (29 loc) · 1.81 KB
/
ext_localconf.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
declare(strict_types=1);
// Prevent Script from beeing called directly
defined('TYPO3') || die();
if (empty($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['tika']['extractor']['driverRestrictions'])) {
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['tika']['extractor']['driverRestrictions'] = [];
}
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['tika']['extractor']['driverRestrictions'] = array_merge(
[
'Local',
],
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['tika']['extractor']['driverRestrictions']
);
/* @var \TYPO3\CMS\Core\Resource\Index\ExtractorRegistry$metaDataExtractorRegistry */
$metaDataExtractorRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Resource\Index\ExtractorRegistry::class);
$metaDataExtractorRegistry->registerExtractionService(\ApacheSolrForTypo3\Tika\Service\Extractor\MetaDataExtractor::class);
$extConf = \ApacheSolrForTypo3\Tika\Util::getTikaExtensionConfiguration();
if ($extConf['extractor'] !== 'solr') {
$metaDataExtractorRegistry->registerExtractionService(\ApacheSolrForTypo3\Tika\Service\Extractor\LanguageDetector::class);
}
unset($extConf);
/* @var \TYPO3\CMS\Core\Resource\TextExtraction\TextExtractorRegistry $textExtractorRegistry */
$textExtractorRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Resource\TextExtraction\TextExtractorRegistry::class);
$textExtractorRegistry->registerTextExtractor(\ApacheSolrForTypo3\Tika\Service\Extractor\TextExtractor::class);
// Add Context Menu and JS
if (TYPO3_MODE == 'BE') {
$GLOBALS['TYPO3_CONF_VARS']['BE']['ContextMenu']['ItemProviders'][1505197586] = \ApacheSolrForTypo3\Tika\ContextMenu\Preview::class;
}
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/backend.php']['constructPostProcess'][] = \ApacheSolrForTypo3\Tika\Hooks\BackendControllerHook::class . '->addJavaScript';