Debugger: Add property $enableDispatch for disable dispatching.
- bug fix
- BC break? no
In some Tracy integrations outside the Nette framework, we need to ensure that the request is not called twice when downloading assets for Tracy.
Outside of Bootstrap, this behavior is not guaranteed, so there should be an easy way to disable dispatch but also have active debug mode.
Thank you.
Couldn't it be internal behavior? It does not make sense to call that method more than once a request anyway, method could handle it itself with private variable.
I may have explained it wrong.
If Tracy registers after another function is called in Bootstrap, the second request to download assets will result in a second call to the action.
For example, if an inappropriately designed router in a hand-written application is first run and calls the logic to insert into the database, the first request will first execute the regular request (and display Tracy), however, immediately afterwards a second request (to download assets) is called, but that will also trigger the insert.
I certainly don't think the correct solution is to add a new variable, but simply to solve the problem.