1
|
|
|
<?php |
2
|
|
|
namespace Aoe\Asdis\Backend\Utility; |
3
|
|
|
|
4
|
|
|
/*************************************************************** |
5
|
|
|
* Copyright notice |
6
|
|
|
* |
7
|
|
|
* (c) 2020 AOE GmbH <[email protected]> |
8
|
|
|
* |
9
|
|
|
* All rights reserved |
10
|
|
|
* |
11
|
|
|
* This script is part of the TYPO3 project. The TYPO3 project is |
12
|
|
|
* free software; you can redistribute it and/or modify |
13
|
|
|
* it under the terms of the GNU General Public License as published by |
14
|
|
|
* the Free Software Foundation; either version 3 of the License, or |
15
|
|
|
* (at your option) any later version. |
16
|
|
|
* |
17
|
|
|
* The GNU General Public License can be found at |
18
|
|
|
* http://www.gnu.org/copyleft/gpl.html. |
19
|
|
|
* |
20
|
|
|
* This script is distributed in the hope that it will be useful, |
21
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
22
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
23
|
|
|
* GNU General Public License for more details. |
24
|
|
|
* |
25
|
|
|
* This copyright notice MUST APPEAR in all copies of the script! |
26
|
|
|
***************************************************************/ |
27
|
|
|
|
28
|
|
|
class FiltersUtility |
29
|
|
|
{ |
30
|
|
|
/** |
31
|
|
|
* Registers filters |
32
|
|
|
* |
33
|
|
|
* @param $extensionPath string |
34
|
|
|
* |
35
|
|
|
* @return void |
36
|
|
|
*/ |
37
|
|
|
public static function registerFilters($extensionPath) |
38
|
|
|
{ |
39
|
|
|
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['asdis']['filters'][] = [ |
40
|
|
|
'key' => 'bubblingPath', |
41
|
|
|
'class' => 'Aoe\Asdis\System\Uri\Filter\BubblingPath', |
42
|
|
|
'file' => $extensionPath . 'Classes/System/Uri/Filter/BubblingPath.php' |
43
|
|
|
]; |
44
|
|
|
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['asdis']['filters'][] = [ |
45
|
|
|
'key' => 'containsInlineData', |
46
|
|
|
'class' => 'Aoe\Asdis\System\Uri\Filter\ContainsInlineData', |
47
|
|
|
'file' => $extensionPath . 'Classes/System/Uri/Filter/ContainsInlineData.php' |
48
|
|
|
]; |
49
|
|
|
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['asdis']['filters'][] = [ |
50
|
|
|
'key' => 'containsProtocol', |
51
|
|
|
'class' => 'Aoe\Asdis\System\Uri\Filter\ContainsProtocol', |
52
|
|
|
'file' => $extensionPath . 'Classes/System/Uri/Filter/ContainsProtocol.php' |
53
|
|
|
]; |
54
|
|
|
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['asdis']['filters'][] = [ |
55
|
|
|
'key' => 'tooShort', |
56
|
|
|
'class' => 'Aoe\Asdis\System\Uri\Filter\TooShort', |
57
|
|
|
'file' => $extensionPath . 'Classes/System/Uri/Filter/TooShort.php' |
58
|
|
|
]; |
59
|
|
|
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['asdis']['filters'][] = [ |
60
|
|
|
'key' => 'wildcardProtocol', |
61
|
|
|
'class' => 'Aoe\Asdis\System\Uri\Filter\WildcardProtocol', |
62
|
|
|
'file' => $extensionPath . 'Classes/System/Uri/Filter/WildcardProtocol.php' |
63
|
|
|
]; |
64
|
|
|
|
65
|
|
|
// Register distribution algorithms |
66
|
|
|
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['asdis']['distributionAlgorithms'][] = [ |
67
|
|
|
'key' => 'hashBasedGroups', |
68
|
|
|
'class' => 'Aoe\Asdis\Domain\Model\DistributionAlgorithm\HashBasedGroups', |
69
|
|
|
'file' => $extensionPath . 'Classes/Domain/Model/DistributionAlgorithm/HashBasedGroups.php' |
70
|
|
|
]; |
71
|
|
|
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['asdis']['distributionAlgorithms'][] = [ |
72
|
|
|
'key' => 'roundRobin', |
73
|
|
|
'class' => 'Aoe\Asdis\Domain\Model\DistributionAlgorithm\RoundRobin', |
74
|
|
|
'file' => $extensionPath . 'Classes/Domain/Model/DistributionAlgorithm/RoundRobin.php' |
75
|
|
|
]; |
76
|
|
|
|
77
|
|
|
} |
78
|
|
|
} |