This repository has been archived by the owner on May 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ext_localconf.php
51 lines (46 loc) · 2.93 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
40
41
42
43
44
45
46
47
48
49
50
51
<?php
defined('TYPO3_MODE') || die();
$boot = function ($_EXTKEY) {
$extractorRegistry = \TYPO3\CMS\Core\Resource\Index\ExtractorRegistry::getInstance();
$settings = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$_EXTKEY]);
if (is_array($settings)) {
if (isset($settings['enable_tika']) && (bool)$settings['enable_tika']) {
$extractorRegistry->registerExtractionService(\Causal\Extractor\Service\Extraction\TikaMetadataExtraction::class);
$extractorRegistry->registerExtractionService(\Causal\Extractor\Service\Extraction\TikaLanguageDetector::class);
}
// Backward compatibility with removed combined option
$externalTools = !isset($settings['enable_tools_exiftool']) && isset($settings['enable_tools']) && (bool)$settings['enable_tools'];
if ($externalTools || (isset($settings['enable_tools_exiftool']) && (bool)$settings['enable_tools_exiftool'])) {
$extractorRegistry->registerExtractionService(\Causal\Extractor\Service\Extraction\ExifToolMetadataExtraction::class);
}
if ($externalTools || (isset($settings['enable_tools_pdfinfo']) && (bool)$settings['enable_tools_pdfinfo'])) {
$extractorRegistry->registerExtractionService(\Causal\Extractor\Service\Extraction\PdfinfoMetadataExtraction::class);
}
// Mind the "!isset" in test below to be backward compatible
if (!isset($settings['enable_php']) || (bool)$settings['enable_php']) {
$extractorRegistry->registerExtractionService(\Causal\Extractor\Service\Extraction\PhpMetadataExtraction::class);
}
}
if (version_compare(TYPO3_version, '7.5', '<') && isset($settings['auto_extract']) && (bool)$settings['auto_extract']) {
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_extfilefunc.php']['processData'][] = \Causal\Extractor\Hook\FileUploadHook::class;
}
/* ===========================================================================
Register post-processors (only useful for mapping helper tool in EM)
=========================================================================== */
$GLOBALS['TYPO3_CONF_VARS']['EXT'][$_EXTKEY]['processors'] = [
'Causal\\Extractor\\Utility\\Array_::concatenate(\', \')',
'Causal\\Extractor\\Utility\\ColorSpace::normalize',
'Causal\\Extractor\\Utility\\DateTime::timestamp',
'Causal\\Extractor\\Utility\\Dimension::extractHeight',
'Causal\\Extractor\\Utility\\Dimension::extractWidth',
'Causal\\Extractor\\Utility\\Dimension::extractUnit',
'Causal\\Extractor\\Utility\\Duration::normalize',
'Causal\\Extractor\\Utility\\Gps::toDecimal',
'Causal\\Extractor\\Utility\\Number::castInteger',
'Causal\\Extractor\\Utility\\Number::extractFloat',
'Causal\\Extractor\\Utility\\Number::extractIntegerAtEnd',
'Causal\\Extractor\\Utility\\SimpleString::trim',
];
};
$boot($_EXTKEY);
unset($boot);