|
@@ -55,13 +55,17 @@ class ScanCommand extends Command
|
|
|
{
|
|
{
|
|
|
$io = new SymfonyStyle($input, $output);
|
|
$io = new SymfonyStyle($input, $output);
|
|
|
|
|
|
|
|
|
|
+ // instanciate twig loader
|
|
|
|
|
+ $loader = new \Twig\Loader\FilesystemLoader(dirname(__FILE__) . '/../../templates');
|
|
|
|
|
+ $twig = new \Twig\Environment($loader);
|
|
|
|
|
+
|
|
|
// evaluate the report path
|
|
// evaluate the report path
|
|
|
$report_path = $input->getOption('report');
|
|
$report_path = $input->getOption('report');
|
|
|
if ($report_path == null) {
|
|
if ($report_path == null) {
|
|
|
$report_path = getcwd() . '/scan_report.html';
|
|
$report_path = getcwd() . '/scan_report.html';
|
|
|
} else {
|
|
} else {
|
|
|
$info = pathinfo($report_path);
|
|
$info = pathinfo($report_path);
|
|
|
- if ($info['extension'] != '.html') {
|
|
|
|
|
|
|
+ if ($info['extension'] != 'html') {
|
|
|
$report_path .= '.html';
|
|
$report_path .= '.html';
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -71,8 +75,6 @@ class ScanCommand extends Command
|
|
|
$scan = $scanController->scanAllAction(true);
|
|
$scan = $scanController->scanAllAction(true);
|
|
|
|
|
|
|
|
// render the twig template
|
|
// render the twig template
|
|
|
- $loader = new \Twig\Loader\FilesystemLoader(dirname(__FILE__) . '/../../templates');
|
|
|
|
|
- $twig = new \Twig\Environment($loader);
|
|
|
|
|
$template = $twig->load('scan_report.twig');
|
|
$template = $twig->load('scan_report.twig');
|
|
|
|
|
|
|
|
$html_report = $template->render(['scan' => $scan]);
|
|
$html_report = $template->render(['scan' => $scan]);
|