| Conditions | 4 |
| Paths | 4 |
| Total Lines | 22 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | protected function execute(InputInterface $input, OutputInterface $output) |
||
| 27 | { |
||
| 28 | $name = $input->getArgument('name'); |
||
| 29 | $cfg = $this->getSelimConfig($input); |
||
| 30 | |||
| 31 | if ($cfg->siteExists($name)) { |
||
| 32 | echo "Security-test for $name:".PHP_EOL; |
||
| 33 | $site = $cfg->getSite($name); |
||
| 34 | $sc = SecurityChecker::getInstance(); |
||
| 35 | $issues = $sc->findIssues(new SilverstripePage($site), true); |
||
| 36 | |||
| 37 | if(count($issues)) { |
||
| 38 | foreach ($issues as $iss) { |
||
| 39 | echo $iss; |
||
| 40 | } |
||
| 41 | }else{ |
||
| 42 | echo "No security issues found."; |
||
| 43 | } |
||
| 44 | } else { |
||
| 45 | Util::reportError("Site with name '$name' doesn't exists!"); |
||
| 46 | } |
||
| 47 | } |
||
| 48 | |||
| 49 | } |