-
-
Couldn't load subscription status.
- Fork 3.7k
[4.0] Debug bar #15472
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
[4.0] Debug bar #15472
Conversation
Add maximebf/debugbar
@elkuku please include the composer files in your commit and place them in the vendor folder. As we are shipping the vendor files with the CMS ;) |
|
@zero-24 that would be over 2.000 files, making it almost impossible for reviewing. Please reconsider.. BTW...
I believe you mean |
|
Yes that folder. Hmm can you .gitignore files out that are not needed? As without shipping than with the cms we cant use that lib in the current architecture. |
|
Run "Composer install", "Composer update |
|
@zero-24 I understand that vendor files have to be included in the final package, I just thought it would be easier to review... @mbabker Of course your're right (as usual), most of the files are Anyway, I created a new branch, you may review the diff here, and if you find it reviewable, I'll merge it in here... |
|
The needed dependencies should be "reviewed" as well anyway. Not exactly codewise but personally I want to see what you're going to pull in. |
|
Files not lines |
|
The 2000 files are with dev stuff which we don't need. So the actual file count is lower. I just did a guess with the 5000 lines. Looking at the other branch, it's actually 20'000 lines we add. So imho there has to be a very good reason to add all those dependencies just for a debug plugin. |
|
Can we use the namespacing convention listed at https://volunteers.joomla.org/teams/joomla-4-architecture/reports/115-joomla-4-architecture-sprint-odense-dk please. So |
|
I like this concept overall :) |
plugins/system/debug/debug.php
Outdated
| $this->app = JFactory::getApplication(); | ||
| } | ||
|
|
||
| if ('com_profiler' == $this->app->input->get('option')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we have something for community builder here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOL I could have sworn that I heard com_profiler before... sorry I almost left the Joomla! community :(
And no, it's not community builder I have in mind here but a component that will display the extended "profile" information that the debug bar is unable to display (due to its size).
It has slipped in here and will be removed.
|
@Bakual and @brianteeman
I thought the change in composer.json might be enough, but you are right. So here are some more infos on files and lines 😉 php-debugbarThe library has one dependency: symfony vardumper
This is a pretty cool replacement for |
Big Thanks for this 😉 Now on the namespacing thing.. I'd love to follow any conventions but I wasn't aware of the existence.. |
|
guys what need to do to get this accepted? |
|
Personally I would go with: https://underground.works/clockwork/ |
only drawback, it forces me to install the browser extension 😄 |
|
|
They need to add a LICENSE file to that repo. The note of the license in the Composer manifest isn't enough. |
did not seen this part :) |
|
@mbabker I wondered about that |
|
It does state MIT in the composer file |
|
sooo, I have tested both Debug bar and Clockwork In 2 words, for Joomla! I would choose "Debug bar". Here is some notes/comparison: Debug bar pros:
cons:
Clockwork pros:
cons:
So I think Clockwork is a nice toy or when someone have a time to fork and adapt it, |
|
@elkuku I have fixed the conflicts https://github.com/Fedik/joomla-cms/tree/debug-bar Now I think, it would be more easy to write new plugin than rewrite existing 😄 |
|
I would welcome to have a more modern debug bar for Joomla. Can you bring that pr into a state for reevaluation please. Thanks! |
|
There's no action happening here. i'd love to see something like this make it into 4.0 - but I guess it's not happening in this PR - so I'm going to close this for now. Of course if it's comes back in sync we can reopen and evaluate :) |
|
This has been updated |
| @@ -1,3 +1,3 @@ | |||
| source 'http://rubygems.org' | |||
| source 'https://rubygems.org' | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true.
|
Sorry but it seems that something got wrong with the last merge... I'd like to close and redo this PR but unfortunately I am unable to close it.... |
Summary of Changes
The goal of this PR is to refactor the debug plugin (currently more than 2.000 lines of code) into smaller pieces.
An external library is used to display a floating debug bar. See a demo
Testing Instructions
runcomposer installafter switching to this branchI have not included any vendor files or modified composer files here to make reviewing easier. Is that correct?
Turn on debug and/or language debug and play with the various options in plugin configuration.
Do not turn on deprecation logging since the logger is using currently deprecated API creating an infinite loop...
Expected result
A beautiful debug toolbar 😉
Actual result
A not so beautiful looong thingy, fixed to the very bottom of the page.
Documentation Changes Required
Alot 👅
Extended Description
While working on a Symfony project, I was amazed by the debug bar they offer and I thought about the old Joomla! plugin...
Integrating the Symfony bar would require a lot of dependencies from Symfony, probably including the Symfony Application class. While this would be amazing, I suspect that this is not gonna happen any time soon...
So I started playing with maximebf/debugbar which claims to be inspired by the Symfony debug bar, but for "non Symfony" projects
;)Thise resulted in some
DataCollectorclasses which, apart from collecting data, are responsible for bringing the collected data to something "serializable".This data is then serialized and written to disk for later analysis.
After a thousand words, here are some screens:
Note: Since the "old" code is still in place, you will see the "old" output as well as the "new " output in the screenshots.
Session
Currently the session display in debug plugin is broken.

Profile
Queries
Only the database queries are displayed. Extended display should happen on a dedicated page.

Deprecation logging
Seems currently broken since file loggers are already using deprecated API, creating funny infinite loops...

Language stuff
Should look as before, just more readable and compact.
Loaded
Errors
Untranslated
Hidden errors
While playing here I discovered a query error that is so much eaten up and swallowed that it does not appear in any way on the standard output. I would bet that this is causing a bug...

Mobile ready
Tested on a 5'' screen with fat fingers and it worked pretty well.
Happy debugging
=;)