| 1 | <?php |
||
| 8 | class RunLevelExtension |
||
| 9 | { |
||
| 10 | private $runLevels = array(); |
||
| 11 | |||
| 12 | private $currentRunLevel; |
||
| 13 | |||
| 14 | public function init(Configuration $_configuration, $runLevel) |
||
| 15 | { |
||
| 16 | $configArray = $_configuration->getConfigArray(); |
||
| 17 | $rulesArray = $configArray['rules']; |
||
| 18 | $this->currentRunLevel = $runLevel; |
||
| 19 | |||
| 20 | foreach ($rulesArray as $key => $ruleElement) { |
||
| 21 | if (array_key_exists('runLevel', $ruleElement)) { |
||
| 22 | $this->runLevels[$key] = (int) ($ruleElement['runLevel']); |
||
| 23 | } else { |
||
| 24 | $this->runLevels[$key] = 0; |
||
| 25 | } |
||
| 26 | } |
||
| 27 | } |
||
| 28 | |||
| 29 | public function setRunLevel($runLevel) |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @Event("Scanner.CheckResponse.isFiltered") |
||
| 36 | */ |
||
| 37 | public function isStopped(Event $event, $ruleName) |
||
| 47 | } |
||
| 48 |