The new "--debug" option is added instead of reusing "-vvv" option to avoid mixing Symfony Console debug output with one produced by In-Portal.
The "Debug Mode" is a mode in which:
- additional debug information is generated during page load
- debugger report is presented to end user (developer) when page is shown
It can also be used in production, where real-time-debugging isn't available. Debug mode is activated based on visitor IP address, but in CLI there is no IP address to use and therefore it's always turned off.
With the help of new "
--debug" command-line argument to both "
tools/cron.php" and "
tools/run_event.php" it would be possible to enable debug mode temporarily.
- in "\Debugger::__construct" method if in PHP_SAPI == 'cli'
- if $_SERVER['argv'] contains '--debug' set "$ip_match" to true
- don't call "\Debugger::appendRequest" method
- create "\InPortal\Core\kernel\Console\ConsoleApplication::getDefaultInputDefinition" method, that will:
- call parent method to get default input definition
- append 'debug' option without parameters to it
- return the result
- in the "tools/cron.php" and "tools/run_event.php" script forward "--debug" option (if any) to executed "/in-portal" script