The Yii Debug Toolbar is a configurable set of panels that display various debug information about the current request/response and when clicked, display more details about the panel's content.
It is a ported to PHP famous Django Debug Toolbar.
Currently, the following panels have been written and are working:
Download sources from GitHub download page.
Extract the yii-debug-toolbar from archive under protected/extensions
For use yii-debug-toolbar need to specify new route in log component:
'log'=>array( 'class'=>'CLogRouter', 'routes'=>array( array( 'class'=>'ext.yii-debug-toolbar.YiiDebugToolbarRoute', 'ipFilters'=>array('127.0.0.1','192.168.1.215'), ), ), ),
ipFilters setting. If you are working locally this option not required.

* Added Views Rendering panel. It allows to view information about rendering process (view names, render methods, context objects and properties) * Miscellaneous fixes
* Added SQL syntax highlighting * Added highlighting of potentially inefficient queries * Miscellaneous fixes and UI enhancements
* Fixed PHP Error: `$_SESSION` variable is not defined
* Enhanced SQL log panel; * Added new tab to SQL debug info with SQL servers info for all used connections; * Added Yii debug status indicator to application settings panel;
* Initial release;
Total 20 comments
The function itself already has condition to check jquery including status.
Hello,
Firstly id like to say this is a very nice tool, and I love having it in such a handy place while developing. Elegant display and very useful information presented.
Im wondering why class YiiDebugToolbar has to load jquery every time the widget is requested [see YiiDebugToolbar::registerClientScripts()]. Is it possible to have it check to see if jQuery is already loaded, and only call
if jQuery is not found? The problem I am experiencing is with some partially rendered views (as popups) within some of the views in my app. As it subsequently loads jQuery for the view-within-a-view, my jQuery library stops functioning, and the resultant popup freezes. When I comment out this line within the YiiDebugToolbar class, everything works fine.
Is it possible to get this updated with the extension? If not I can extend this out myself.
Thanks!
I have my config set like this:
YiiDebugToolbarRoute tries to call YiiDebugToolbar->appendPanel() ... but that doesn't exist. Are additionalPanels not supported? Or were appendPanel and prependPanel accidentally left out?
Thanks!
Elapsed time - This is the time elapsed from the time of receipt of the request to the server, see $_SERVER['REQUEST_TIME'] Page Load Time - This is the time elapsed from the time of start a application
Here are some stats of "hello world" application from my Mac. No database connection.
Why elapsed time is much higher than page load time? How are they defined? 0.9 sec is quite slow for a simple page like this. :)
What exactly you mean?
I am not getting any instruction to use this extension. Please help. thanks
The only feature i'm missing right now is ability to set levels in config.
OceanWind, that's correct, so if this is production you probably don't want that (at least not long term). Are you sure that the ip address that your production system sees when you go to it is the one you entered in ipTables? This sounds somewhat similar to my problem, where my external ip was different than my internal ip, and thus the plugin didn't recognize me when I cam in from my home system.
One very hacky way (which I used) to determine that was to add a Yii::log($ip, 'error'); to the allowIp function in YiiDebugToolbarRoute.php. Check the application log for the reported ip address and add it to the extensions ipFilters list. That showed me what my request came in on, and then I added that to the ipFilters variable. Maybe this helps...
Thanks, Sven.
I was hoping to get a display on my production system, where the problem is occurring.
Won't setting 'ipFilters'=array('*') make the debugger display for everyone?
Oceanwind, you may want to try setting ipFilters to:
'ipFilters'=>array('*')
At least temporarily. If that gets the plugin displayed, you can then try to figure out what ip address is seen by apache.
Is there anything else I need to do to get this to display? I've entered my IP into ipFilters, loaded the plugin into extensions, and set the DB connects to enable profiling and paramLogging. But nothing happens...
:-/
This debugger is way better than others I have seen in yii extension lib...
When I was trying to get WSDL from site with enabled yii-debug-toolbar, I was getting WSDL with HTML from yii-debug-toolbar.
Here is temporary solution YiiDebugToolbarRoute.php
Hello comment #6372 :)
You're right. I was trying to be politically correct and I was using Yii::app->end(). Ignoring it and just calling Php's exit() function does the trick.
To recap:
In order to correctly download a file (from inside a controller):
Just don't use the $terminate option of the sendFile and rudely call exit() yourself after sending the file...
Hey, I'm comment #6372:D
I found out that you obviously can disable the toolbar with the exit function. Yii::app()->end() does not work because it calls some "end-methods", so the toolbar.
Of course it only helps in specific situations, for example sending a file to the browser.
Hello,
Really nice extension but I have a major problem (that has ALREADY been pointed to (in one way or another) THREE (3) different times (in comments #6372, #6248 and #5763) but still there is no resolution.
When I download a file with Yii::app()->request->sendFile(...)
The web debug html code is also injected in the downloaded file. Pretty much the same side effect as the Ajax request and webservices calls already mentioned.
How can I temporarily turn it off for specific controller actions...?
Thank you...
Hey blacksheep,
I was also unable to see the toolbar. For me it turned out to be an issue with the extensions ipFilter. If you don't specify one, the extension will use:
'ipFilters'=>array('127.0.0.1','::1')
that's quite nice/reasonable, but in my case I had routing set up a little more complicated (going out to the ether and then coming back through my router). So I temporarily set it to:
'ipFilters'=>array('*')
which is not secure, but allowed me to see the toolbar. After taht I just had to identify what ip was actually being used. One very hacky way (which I used) was to add a Yii::log($ip, 'error'); to the allowIp function in YiiDebugToolbarRoute.php. Check the application log for the reported ip address and add it to the extensions ipFilters list. Hope this helps.
how can i see the toolbar?? i follow the instruction, but how can i read into the toolbar? thanks!
Is there a possibility to disable the toolbar for a specific action?
Leave a comment
Please login to leave your comment.