-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
System - Debug relies on __destruct which is never triggered (Fix #5826) #7279
Conversation
hmm after applying the patch i can't see any issues with the debug plugin output.
hmm not sure if/how we can test this. This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7279. |
Just what you did. Instead of the debug data being rendered while PHP is going through the shutdown process (this is when |
Thanks. BTW. Travis want to have a
How to test the advanced test case
|
Fixed |
PR works as intended. This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7279. |
RTC Thanks 😄 This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7279. |
So the thing with this is now the debug plugin wants to load first to ensure that all the loggers are primed. But also last when dumping data out to ensure the timers in onAfterRespond are as accurate as possible (and db queries aren't missing etc). I'm not sure if there's some sort of workaround for this or it's just something we're going to have to sucker up and document appropriately. I mean what's the ideal even? The plugin being first in the list so the loggers are active? |
The actual fix in this PR is that the plugin renders the debug console while PHP shuts down and if you're using custom code to have a different shutdown operation, then the destructor does not get triggered. Since plugins are prioritized by class and not by event (another inherent weakness in JEvent), there is no way to re-prioritize the execution orders.
A proper long term fix is going to mean refactoring the event system to properly subscribe plugins to events with method level prioritization, not just class level. |
Thank you @mbabker! Merged. |
This PR addresses #5826 by changing the method that renders the system profiler data to listen to the
onAfterRespond
event, the absolute last thing that Joomla does before PHP should start shutting down the application.Testing Instructions
Make sure the profile data still renders correctly.