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 way I've dealt with AJAX in the past was by designing the app/api such that I could GET or POST using a generic form. In some cases, I've also used Firebug, which has a tab for viewing a rendered response.
Is it possible to get the log from the ajax requests ?
@m00nk ,
Did you find the solution to it? I am also having the same illegal offset error. Let me know.
Is it possible to show the function execution time? I eam END-START= time? Because there is only the START time.
Great work!
Here's another FYI for people still having problems. If you are having trouble with the ipFilters not working for you, it could be because your client/machine's IP Address isn't being detected. Instead, your Gateway, Load Balancer, or Proxy's IP Address may be getting filtered. To test this, try checking the return value of var_dump($_SERVER['REMOTE_ADDR']) and if the IP Address does not match your machine's IP Address, then that could be your problem.
This extension is setup to retrieve your IP Address using Yii::app()->request-getUserHostAddress(), which is most of the time the same as $_SERVER['REMOTE_ADDR']. The return value of $_SERVER['REMOTE_ADDR'] won't necessarily be your machine's IP. There are two ways in which I would deal with this. Either refactor YiiDebugToolbarRoute::init() or extend CHttpRequest and define your own getUserHostAddress().
Within either of the aforementioned methods, you may retrieve your real IP by using apache_request_headers() and parsing the X-Forwarded-For header. For example, you may add something like this:
Please note that this may not always work. The apache_request_headers() function has always worked for me, and I have never ran into a situation (yet) where it hasn't.
Good luck.
Thanks, all is working and this extensions is really a must have
Enable SQL logging in your configuration...
As a side note, this works GREAT with the yii-environment extension.
Is this toolbar still working with 1.1.12 ?
I can't figure how to enable. I extracted into right directory, i configured like example, but ... nothing new showed on the page
thanx krowe ! that is working :)
Try to download and use latest version from GitHub
@jurrasic82: I see now. Ok, this is coming back to me now. I had this problem for awhile myself and I fixed it by modifying YiiDebugToolbar::createPanels(). Here is the code which worked for me:
EDIT: The only difference is that we've wrapped a portion of the code in an if(is_array()) block.
Could you provide a configuration that you use for this widget?
No krowe ... you misread the error
/home/yii/my/framework/YiiBase.php exists and I have not modified anything in the framework directory.
What that error is telling is that file in the line (423) try to do an include of a file that does not exists, in this case 0.php
That's because I sent the Stack Trace:
YiiDebugToolbar.php at line 127 is running this YiiDebugToolbar->createPanels() Because $config is array("class" => 0), tries to import a file called 0.php since the Yii autoload override tries to get that file.
It's not about Yii framework ... it's about the $config array... there's so problem there.
Anyone ?
@jurassic82 This looks like a file not found error in your index.php file. The location: /home/yii/my/framework/YiiBase.php doesn't exist. This is probably because you have one too many ../ in the path. You'll need to edit the line that looks like this: $yii=dirname(FILE).'/../../Apps/Yii/yii.php'; to make a good path.
PS: This question is probably more suited to the forums than this wiki.
EDIT: Actually, upon looking at this closer I see that the file not being found is the YiiBase.php file. This file is included by yii.php and it's relative location shouldn't ever be changed. Did you modify your library files? If so I'd change them back.
I had to put those lines you posted for m00nk ... but however:
include(0.php): failed to open stream: No such file or directory /home/yii/my/framework/YiiBase.php(423)
Stack Trace
0
1
2
3
4
help please ! ;)
Yes I checked it and I have an HTML validation error which says I'm missing a /div.
Did you check for JS errors? Are you using a debbuger like firebug?
I use this tool for development and usually everything is fine. I have a page which it doesn't like though and it has been quite difficult to figure out whats going on. I think it is because the extension is printing out one of my vars which has a /div string in it. I'm wondering if there is a way to disable this extension for only some pages. Another related question I have is that I wonder if it is possible to disable only certain panels. The best solution for me would be if it could do both but either one of those options would get me through this much easier. Thanks.
@m00nk,
It's possible that $config isn't an array. What you can try is add the following before line 168 so the code looks like the following:
I thought I remember reading that you can use short array syntax like in other languages in 5.4. If not, replace [] with array(). Good luck.
Leave a comment
Please login to leave your comment.