-
Notifications
You must be signed in to change notification settings - Fork 13
/
ext_localconf.php
30 lines (27 loc) · 1.21 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
<?php
defined('TYPO3_MODE') || die('Access denied.');
// Get extension configuration
if (class_exists(\TYPO3\CMS\Core\Configuration\ExtensionConfiguration::class)) {
$extensionConfiguration = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
\TYPO3\CMS\Core\Configuration\ExtensionConfiguration::class
);
$configuration = $extensionConfiguration->get('metadata');
} else {
// @extensionScannerIgnoreLine Fallback to access extConf for TYPO3 CMS version below 9.5
if (!empty($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['metadata'])) {
$configuration = $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['metadata'];
if (!is_array($configuration)) {
$configuration = unserialize($configuration);
}
}
}
// Register metadata extractor for images if configured so.
if (!empty($configuration['extract_image_metadata'])) {
\TYPO3\CMS\Core\Resource\Index\ExtractorRegistry::getInstance()
->registerExtractionService(\Fab\Metadata\Index\ImageMetadataExtractor::class);
}
// Register metadata extractor for pdf if configured so.
if (!empty($configuration['extract_pdf_metadata'])) {
\TYPO3\CMS\Core\Resource\Index\ExtractorRegistry::getInstance()
->registerExtractionService(\Fab\Metadata\Index\PdfMetadataExtractor::class);
}