forked from christophlehmann/imageoptimizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathext_localconf.php
42 lines (36 loc) · 1.73 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
<?php
$configuration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['imageoptimizer']);
if (!isset($signalSlotDispatcher)) {
$signalSlotDispatcher = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Extbase\SignalSlot\Dispatcher');
}
if ((isset($configuration['jpgOnUpload']) && (bool)$configuration['jpgOnUpload'] === TRUE) ||
(isset($configuration['pngOnUpload']) && (bool)$configuration['pngOnUpload'] === TRUE) ||
(isset($configuration['gifOnUpload']) && (bool)$configuration['gifOnUpload'] === TRUE) ||
(isset($configuration['svgOnUpload']) && (bool)$configuration['svgOnUpload'] === TRUE)) {
$signalSlotDispatcher->connect(
'TYPO3\\CMS\\Core\\Resource\\ResourceStorage',
\TYPO3\CMS\Core\Resource\ResourceStorage::SIGNAL_PreFileAdd,
'Lemming\\Imageoptimizer\\FileAspects',
'addFile'
);
$signalSlotDispatcher->connect(
'TYPO3\\CMS\\Core\\Resource\\ResourceStorage',
\TYPO3\CMS\Core\Resource\ResourceStorage::SIGNAL_PreFileReplace,
'Lemming\\Imageoptimizer\\FileAspects',
'replaceFile'
);
}
if ((isset($configuration['jpgOnProcessing']) && (bool)$configuration['jpgOnProcessing'] === TRUE) ||
(isset($configuration['pngOnProcessing']) && (bool)$configuration['pngOnProcessing'] === TRUE) ||
(isset($configuration['gifOnProcessing']) && (bool)$configuration['gifOnProcessing'] === TRUE)) {
$signalSlotDispatcher->connect(
'TYPO3\\CMS\\Core\\Resource\\ResourceStorage',
\TYPO3\CMS\Core\Resource\Service\FileProcessingService::SIGNAL_PostFileProcess,
'Lemming\\Imageoptimizer\\FileAspects',
'processFile'
);
}
if (TYPO3_MODE === 'BE') {
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status']['providers']['ImageOptimizer'][] =
\Lemming\Imageoptimizer\StatusReport::class;
}