-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Description
Symfony version(s) affected
6.4.*
Description
Running command via messenger with RunCommandMessage
will disable profiler for the current request.
How to reproduce
create controller that dispatches RunCommandMessage
and look for the profiler
Possible Solution
allow mixing of virtual (cli) and http request stack (use them interchangeably).
maybe cli profiler should be represented as subrequest in this context?
Additional Context
Profiler gets disabled as the --profile
option is not set:
symfony/src/Symfony/Bundle/FrameworkBundle/EventListener/ConsoleProfilerListener.php
Lines 63 to 67 in a314b65
if (!$input->hasOption('profile') || !$input->getOption('profile')) { | |
$this->profiler->disable(); | |
return; | |
} |
But simply making RunCommandMessageHandler
profiler configuration aware (to append the --profile
cli parameter option) will not work straightforwardly as VirtualRequestStack
will forbid mixing of RequestStacks
if ($this->decorated->getCurrentRequest()) { | |
throw new \LogicException('Cannot mix virtual and HTTP requests.'); | |
} |
HeahDude