What is the correct way to add PHP DebugBar without hacking core?
Permalink 1 user found helpfulUsing PHP Debug bar as an example (http://phpdebugbar.com/) what would be the correct way to add this functionality? Is it even possible without hacking core?
Method 1:
When i added debugbar to concrete's composer.json, and ran composer update, it updated ALL the bundles in the concrete project too! This broke concrete itself (Got a white screen of death after doing this) maybe wild cards should not be used in the composer file for release versions? Also, isnt this technically "hacking core" will these files not be overwritten when you update concrete5.7?
Method 2:
So i used "composer require" and installed just the DebugBar and used the same code in the Docs. I got an error that DebugBar class Could not be found. Probably because it has to be injected somewhere in the view object.
I am sure its possible to extend concrete5.7 at this level but i am trying to find out the proper way to do these things so i am not "hacking core"
But when i put the code in the template, I get an error telling me that DebugBar object could not be found
Fresh install of Concrete Version 5.7.4.2
Empty site
I ran composer update and get a white screen. No URL works anymore.
As for your blank screen, configure concrete5 to display errors (display_errors). I'm on my iPad right now, but you can find the info right here:https://www.concrete5.org/community/forums/5-7-discussion/how-to-ove... It's the second post, at the very bottom. Put that in your application/config/concrete.php
As for the composer update error, after doing as you mentioned, i see the true error:
Whoops \ Exception \ ErrorException (E_ERROR) HELP Class 'TrueBV\Punycode' not found ...... public function __construct($data = null) { $this->punycode = new Punycode('UTF-8'); parent::__construct($data); } ......
Looks like some bundle class was added/removed/changed in some newer version.
I looked over some of the documentation and it looks very interesting.
https://github.com/Mnkras/php_debugbar...
I am also including the package with the dependencies already installed as an attachment. It has everything it needs to be installed.
Once installed, the toolbar should be available to use.
I believe it needs further customization to make the most of what it can do.
I am not sure what type of customization could be done.
Also, it currently does not get POST/GET data from block and dashboard single page forms. These forms use AJAX to transfer data.
On the PHP Debug Bar website it lists that it handles AJAX requests. We all need to brainstorm to figure out how to enable AJAX request collection.
http://phpdebugbar.com/docs/ajax-and-stack.html#ajax-and-stacked-da...
https://github.com/dorian-marchal/concrete5-kint-debug...
Nice find, have you tried it yet?
But this seems to be a sort of replacement for calling var_dump, from what I gather.
You can easily drop that in your header and footer of your theme. If not everything is being debugged, you could look at using some before render events in a module's on start function or something.