-
Notifications
You must be signed in to change notification settings - Fork 0
/
ext_localconf.php
94 lines (82 loc) · 3.15 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?php
defined('TYPO3_MODE') || die();
/** @var \TYPO3\CMS\Extbase\SignalSlot\Dispatcher $signalSlotDispatcher */
$signalSlotDispatcher = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class
);
$signalSlotDispatcher->connect(
\TYPO3\CMS\Core\Resource\ResourceStorage::class,
\TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PreFileAdd,
\Extrameile\EmAntivirus\Slot\ResourceStorageSlot::class,
\Extrameile\EmAntivirus\Slot\ResourceStorageSlot::SLOT_PreFileAdd
);
$signalSlotDispatcher->connect(
\TYPO3\CMS\Core\Resource\ResourceStorage::class,
\TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PreFileReplace,
\Extrameile\EmAntivirus\Slot\ResourceStorageSlot::class,
\Extrameile\EmAntivirus\Slot\ResourceStorageSlot::SLOT_PreFileReplace
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addService(
'em_antivirus',
'antivirusScanner',
\Extrameile\EmAntivirus\Service\ClamAvService::class,
[
'title' => 'Clam AV Service',
'description' => 'Scans files/folders with clamav',
'subtype' => 'fileScanner,folderScanner',
'available' => true,
'priority' => 50,
'quality' => 50,
'os' => '',
'exec' => 'clamscan',
'className' => \Extrameile\EmAntivirus\Service\ClamAvService::class,
]
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addService(
'em_antivirus',
'antivirusScanner',
\Extrameile\EmAntivirus\Service\EsetService::class,
[
'title' => 'Eset Antivirus Service',
'description' => 'Scans files/folders with eset antivirus',
'subtype' => 'fileScanner,folderScanner',
'available' => true,
'priority' => 80,
'quality' => 60,
'os' => '',
'exec' => 'esets_scan',
'className' => \Extrameile\EmAntivirus\Service\EsetService::class
]
);
$typo3Version = '0.0.0';
if (!defined('TYPO3_version')) {
// Since TYPO3 10.3
$typo3Version = (new \TYPO3\CMS\Core\Information\Typo3Version())
->getVersion();
} else {
$typo3Version = TYPO3_version;
}
if (version_compare($typo3Version, '9.5.0', '>=')) {
$currentApplicationContext = \TYPO3\CMS\Core\Core\Environment::getContext();
} else {
$currentApplicationContext = \TYPO3\CMS\Core\Utility\GeneralUtility::getApplicationContext();
}
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addService(
'em_antivirus',
'antivirusScanner',
\Extrameile\EmAntivirus\Service\DevelopmentAvService::class,
[
'title' => 'TYPO3 Development AV Service',
'description' => 'Scans files for "virus" as content in the first 1024 bytes',
'subtype' => 'fileScanner,folderScanner',
'available' => $currentApplicationContext->isDevelopment(),
'priority' => 1,
'quality' => 1,
'os' => '',
'className' => \Extrameile\EmAntivirus\Service\DevelopmentAvService::class
]
);
// Add to reports Module
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status']['providers']['system'][]
= \Extrameile\EmAntivirus\Reports\AntivirusReportStatus::class;
unset($signalSlotDispatcher);