forked from Leuchtfeuer/typo3-secure-downloads
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ext_localconf.php
57 lines (47 loc) · 2.27 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
52
53
54
55
<?php
defined('TYPO3_MODE') || die('Access denied.');
call_user_func(
function ($extensionKey) {
// Load libraries when TYPO3 is not in composer mode
if (\TYPO3\CMS\Core\Core\Environment::isComposerMode() === false) {
require \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($extensionKey) . 'Libraries/vendor/autoload.php';
}
// Load extension configuration and add link prefix to additionalAbsRefPrefixDirectories
$GLOBALS['TYPO3_CONF_VARS']['FE']['additionalAbsRefPrefixDirectories'] .= sprintf(
',%s',
(new \Leuchtfeuer\SecureDownloads\Domain\Transfer\ExtensionConfiguration())->getLinkPrefix()
);
##################
# FAL DRIVER #
##################
$driverRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Resource\Driver\DriverRegistry::class);
$driverRegistry->registerDriverClass(
\Leuchtfeuer\SecureDownloads\Resource\Driver\SecureDownloadsDriver::class,
\Leuchtfeuer\SecureDownloads\Resource\Driver\SecureDownloadsDriver::DRIVER_SHORT_NAME,
\Leuchtfeuer\SecureDownloads\Resource\Driver\SecureDownloadsDriver::DRIVER_NAME,
'FILE:EXT:secure_downloads/Configuration/Resource/Driver/SecureDownloadsDriverFlexForm.xml'
);
// Register default token
\Leuchtfeuer\SecureDownloads\Registry\TokenRegistry::register(
'tx_securedownloads_default',
\Leuchtfeuer\SecureDownloads\Domain\Transfer\Token\DefaultToken::class,
0,
false
);
// Register default checks
\Leuchtfeuer\SecureDownloads\Registry\CheckRegistry::register(
'tx_securedownloads_group',
\Leuchtfeuer\SecureDownloads\Security\UserGroupCheck::class,
10,
true
);
\Leuchtfeuer\SecureDownloads\Registry\CheckRegistry::register(
'tx_securedownloads_user',
\Leuchtfeuer\SecureDownloads\Security\UserCheck::class,
20,
true
);
// Add MimeTypes
$GLOBALS['TYPO3_CONF_VARS']['SYS']['FileInfo']['fileExtensionToMimeType'] += \Leuchtfeuer\SecureDownloads\MimeTypes::ADDITIONAL_MIME_TYPES;
}, 'secure_downloads'
);