-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It doesn't seem possible to disable the HTML report #36
Comments
Hi, probably the workaround could be to inverse the method call to: ->disableReportMode()
->disableReport() In any case, the report mode is a mode in which all malware are skipped (to avoid user interaction on the CLI) and allows you to have a log (old version of the HTML report) of the detected malware and also to automatically enable the generation of the HTML report. I changed it to force the settings only on CLI and not on programmatic usage (but it will disable or enable the html report as well because these two features are linked). I also change the default values of arguments checking if is running on CLI or not. |
I thought changing the order would work too but as I worked through it I think the stuff in the arguments method was overriding it anyway. I'll try the fix when back at my desk. It looks good at first sight anyway. Thanks! |
Kind of ironic but because I now actually want to keep the HTML generated report the recent changes have nerfed that possibility. I'm not 100% clear on what is going on but to debug I'm dumping out a copy of Regardless of any methods I call programmatically both Now the first thing to note if I've understood correctly is that this should disable report mode (the old log) but enable the report (the HTML report): ->disableReportMode() However, self::setReport($mode); So if you call So, no big deal, I can just call: ->disableReportMode()
->enableReport() At least momentarily, after
So far, so good. However, according to the fairly rudimentary debugging I'm doing (I don't have xdebug set up right now) The calling sites for these are The final place where // Report mode
self::setReportMode(isset(self::$argv['report']) && self::$argv['report']); When running programmatically Finally the last issue is - and probably the most significant - that // Report
if (isset(self::$argv['disable-report']) && self::$argv['disable-report']) {
self::setReport(!self::$argv['disable-report']);
} EDIT: I guess I can pass So this time we've gone too much the other way. It doesn't seem possible to enable the HTML report. Just to be clearer about my current requirements my aims are:
Sorry for all this trouble! |
Also I've been hacking around a bit to try and get it to generate the report and output the correct data but it doesn't. As well as generating the HTML report populated with the results of the scan, I want the |
Given the following code:
Executing this will still generate the HTML report. I tried various combinations as I wasn't totally clear of the difference between
disableReport
anddisableReportMode
.disableReportMode
seems to cancel outdisableReport
becausesetReportMode
seems to always callenableReport
:My understanding is that all reporting should be disabled anyway if not using the CLI:
But I believe the
Scanner::arguments
method may be overriding this:As I noted above, regardless of what is passed into
setReportMode
theenableReport
method is called.Also you seem to be enabling report mode when NOT running in CLI which is the opposite of what happens in the constructor.
This all being said, I think I actually quite like the HTML generated report and I may well end up using it in my project so if fixed, I'm hoping it will still be possible to generate the HTML report even if not using the CLI.
The text was updated successfully, but these errors were encountered: