-
-
Notifications
You must be signed in to change notification settings - Fork 29
/
ext_localconf.php
39 lines (32 loc) · 1.57 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
37
38
39
<?php
declare(strict_types=1);
use ApacheSolrForTypo3\Tika\Service\Extractor\LanguageDetector;
use ApacheSolrForTypo3\Tika\Service\Extractor\MetaDataExtractor;
use ApacheSolrForTypo3\Tika\Service\Extractor\TextExtractor;
use ApacheSolrForTypo3\Tika\Util;
use TYPO3\CMS\Core\Resource\Index\ExtractorRegistry;
use TYPO3\CMS\Core\Resource\TextExtraction\TextExtractorRegistry;
use TYPO3\CMS\Core\Utility\GeneralUtility;
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']
);
$extConf = Util::getTikaExtensionConfiguration();
$registerMetaDataExtractorConf = $extConf['registerMetaDataExtractor'] ?? 1;
if ($registerMetaDataExtractorConf == 1) {
/** @var ExtractorRegistry $metaDataExtractorRegistry */
$metaDataExtractorRegistry = GeneralUtility::makeInstance(ExtractorRegistry::class);
$metaDataExtractorRegistry->registerExtractionService(MetaDataExtractor::class);
if ($extConf['extractor'] !== 'solr') {
$metaDataExtractorRegistry->registerExtractionService(LanguageDetector::class);
}
}
unset($extConf);
/** @var TextExtractorRegistry $textExtractorRegistry */
$textExtractorRegistry = GeneralUtility::makeInstance(TextExtractorRegistry::class);
$textExtractorRegistry->registerTextExtractor(TextExtractor::class);