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:
- Request timer
- A list of superglobals
- Application settings
- SQL queries including time to execute and param bindings
- Logging output via Yii built-in logging
Requirements ¶
- JavaScript enabled browser
- Yii 1.1.4 +
Installation ¶
Extract the yii-debug-toolbar
from archive under protected/extensions
Usage and Configuration ¶
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'),
),
),
),
- Make sure your IP is listed in the
ipFilters
setting. If you are working locally this option not required. - Enable Profiling and ParamLogging for all used DB connections.
Resources ¶
Working preview ¶
Change Log ¶
December 10, 2013 ¶
* Updated design
* Fixed few bugs reported by users on GitHub issues page
November 28, 2011 ¶
* Added Views Rendering panel. It allows to view information about rendering process (view names, render methods, context objects and properties)
* Miscellaneous fixes
September 21, 2011 ¶
* Added SQL syntax highlighting
* Added highlighting of potentially inefficient queries
* Miscellaneous fixes and UI enhancements
Juny 27, 2011 ¶
* Fixed PHP Error: `$_SESSION` variable is not defined
Juny 21, 2011 ¶
* 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;
Juny 20, 2011 ¶
* Initial release;
cant make it work...
'log'=>array( 'class'=>'CLogRouter', 'routes'=>array( array( 'class'=>'ext.yii-debug-toolbar.YiiDebugToolbarRoute', 'ipFilters'=>array('127.0.0.1'), ), ), ),
'import'=>array( 'application.models.*', 'application.components.*', 'application.extensions.yii-debug-toolbar.*' ),
'db'=>array( 'connectionString' => 'mysql:host=localhost;dbname=test', 'emulatePrepare' => true, 'username' => 'xxx', 'password' => 'xxx', 'charset' => 'utf8', 'enableProfiling'=>true, 'enableParamLogging'=>true, ),
have i missed something?
RE: cant make it work...
It is wrong - installed the extensions in extension/yii-debug-toolbar, extract the yii-debug-toolbar from archive under protected/extensions.
Import section changes not required
Thanks
Good work.
Thanks
Great work, grazie :)
cant make it work... - Answer
Just extract the extension and do just as said
'log'=>array( 'class'=>'CLogRouter', 'routes'=>array( array( 'class'=>'ext.yii-debug-toolbar.YiiDebugToolbarRoute', 'ipFilters'=>array('127.0.0.1','192.168.1.215'), ), ), ),
It works just fine :)
Incredible Extension
This is one incredible and extremely useful extension. I really hope it to be updated with some more panels though these are great too :)
Fantastic idea!
Just one minute to install, very handful. I'm sure it will save me tons of debug hours. Thanks!
found my issue
for some reason having just:
'ipFilters'=>array('127.0.0.1'),
dont work for me, but when i made it:
'ipFilters'=>array('127.0.0.1','::1'),
it now works great. thank you for a great extension.
PS. (my MAMP PRO localhost points to 127.0.0.1:80).
Issue
I get only bug icon in upper right corner of page and clicking on it does nothing
RE > to idrozd Issue
Hi idrozd. Can you provide more info about your issue, please? Version of browser, OS, PHP, etc... Your help would be very useful. If you do not complicate to publish issue in project issue tracker on GitHub . Thanks.
New Tab Generator
It's a great extension Thanks
more over creating a new tab is super easy,
just an idea : why not have a Tab Generator in gii :)
i have a thinking
if run
the debug pannel dos not show
why?
RE: i have a thinking
Panels rendering, but hidden by styles
See https://github.com/malyshev/yii-debug-toolbar/blob/master/yii-debug-toolbar/views/yii_debug_toolbar.php#L4
Great extension
Thanks for creating this extensions, it works flawlessly
(oh one typo in settings.php -> Componets)
Congratulations to the developer
Great extension!
Would be nice had a way to put the rendered output to a variable.
BUG BUG BUG BUG BUG
Because I am a Chinese, English poor Chinese people, so I can only use Chinese complaints you. If you are not Chinese, you can use translate.google.com.
因为我是一个中国人,英文很差的中国人,所以我只能用中文投诉你。如果您中文不行,您可以借助translate.google.com。
我在使用您的插件的时候发现一个严重的BUG:
在登陆的时候会出现SESSION丢失的情况,导致无法登陆的情况出现,另外一个debug toolbar同样也有这个问题,只不过它只是偶尔出现(rights插件用的就是那个插件),我是经过朋友的推荐使用了您的插件,想不到碰到了这个问题。
我之前猜测是不是jquery.cookie.js重复引用导致的问题,但是我注释了您的关于注册相关脚本的代码之后发现这个问题同样有出现,所以我确定是您的插件出现了问题,可能这个问题是所有debug toolbar都有的问题,也许您没有在chromen和firefox下测试过这个情况,所以您并不知情。
希望您尽快解决这个问题,如果您解决了这个问题,希望您能发份EMail到我的邮箱:yuan1238y@sina.com
这个BUG在IE下不会出现,但是在chrome和firefox下会出现
RE: > BUG @yuanchensi
I use the Chrome and Firefox for testing. And bug not reproduced. I think issue described by you already fixed. Try to download latest version on GitHub. Such issue has been fixed by Ryadnov couple days ago.
我使用Chrome和Firefox的測試。和錯誤不再現。我覺得你描述的問題已經解決。嘗試 GitHub上下載最新版本。這些問題已得到修復由Ryadnov前幾天。
RE:> skinner
非常感谢您的回复。
我刚刚通过您说的方法,下载了最新版本之后进行测试,发现问题同样存在。
不知道是不是我的配置的问题呢?我现在的YII版本为1.1.8,
config.php
'routes'=>array( // debug toolbar configuration array( 'class'=>'YiiDebugToolbarRoute', 'ipFilters'=>array('127.0.0.1'), ), array( 'class'=>'CFileLogRoute', 'levels'=>'info', ), ),
Thank you for your reply.
I just through the way you said, downloaded the latest version after testing found that the problem also exists.
I do not know the configuration of the problem? I am now YII version 1.1.8
doesn't work for me
Clicking on the button doesn't do anything. Whatever browser I use (opera, ie9, ff, chrome) on windows with xampp. All the assets are there so that couldn't be the problem. Configuration:
'log'=>array( 'class' => 'CLogRouter', 'routes' => array( array( 'class' => 'ext.yii-debug-toolbar.YiiDebugToolbarRoute', 'ipFilters' => array('127.0.0.1', '::1', '192.168.1.101'), ), ), ),
problem with excel export
when the debug is activated when exporting an excel file with phpexcel i get an error in the excel :
XML ERROR in ExcelWorkbook description REASON: Illegal Tag FILE: test.xls_______________________ VALUE: $(function() { yiiDebugToolbar.init(); });
how can i disable the debugtoolbar temporarily at runtime so it doesn't add the code: $(function() { yiiDebugToolbar.init(); }); ?
@Instinct
Please read, related issue has been fixed https://github.com/malyshev/yii-debug-toolbar/issues/5
@ortenheim
YiiDebugToolbar can be disabled in runtime similar to other yii log routes. I have encountered the same problem with other loggers who add their output to the bottom of the page.
Problem with queries
I have problem with queries, this tool always shows 0 queries and shows this information:
No SQL queries were recorded during this request or profiling the SQL is DISABLED.
I have previusly used XWebDebugRouter and it works fine.
@micz
This is very strange about "XWebDebugRouter and it works fine" because Yii not logged queries to the database if not enabled profiling of queries in the database connection parameters. So probably you are not enabled profiling and param logging in your database connections?
@skinner
I know why is that, in Xdebug there is no profiling only tracing. OK, so I have to enable profiling, thanks.
Bug??
Hi!
I'm trying to install this extension and get:
Error: $.proxy is not a function
Archivo de origen: http://xxx/assets/c23726ab/yii.debug.toolbar.js
Línea: 7
Thanks in advance.
Great extension
Thanks, you did a very nice and useful extension !
Excellent work
Nice work, especially for query profiling.
Feature Request: ELMAH
The extension works great for current request. However, is it possible to turn it into a ELMAH like functionality where it is logging not just about the current request/response? Instead, it would be awesome, if we can see the log/sessionId/stackTrace, whenever there is an unexpected error from other users requests. This will greatly help us monitor the latest incoming errors, instead of combing through logs periodically. Plus, we might have missed logging at some locations, so a global error catcher+filter would be a nice addition.
Moving from .Net to PHP, I do kind miss ELMAH much.
$.cookie error on init()
I've a js error when calling init() function. The jquery.cookie library is not load yet and init() function is called.
I've modify YiiDebugToolbar.php line 151 from
$cs->registerScriptFile($this->assetsUrl . '/yii.debug.toolbar.js', CClientScript::POS_END);
to
$cs->registerScriptFile($this->assetsUrl . '/yii.debug.toolbar.js', CClientScript::POS_HEAD);
Using this way, yii.debug.toolbar.js is loaded in
with jquery.cookie.I hope it will be included in next release
use IN condition error
example:
If you are use "IN" in sql, generate sql is follow:
id in (:ids) ... bould with :ids='1, 2, 3'....
you will change YiiDebugToolbarPanelSql file code:
293 to: $params = explode(', :', substr($params, 1));
299 to: $binds[":$key"] = trim($value);
testing v1.1.9
Incredible extension with a few quirks
This is an incredible extension. Absolutely fantastic and easy to use.
My only recommendation is for users integrating this into applications without databases or that have not yet instantiated their databases.
In my case, I integrated the extension into a new project before I'd set up any database connections and lost some time wondering why the javascript was nonfunctional. I think that somewhere down the road it would be nice to see some meaningful error handling or graceful degradation if it cannot connect and profile. Otherwise, I can't speak highly enough about it.
New functionality
Hello guys.
Newest version on GitHub contains new debug panel. View rendering debug panel allows to see all info about rendered view files. I glad to get your feedbacks about how it works in your applications.
SQL DISABLED
Hi guys ,
I was trying to get my Querys and I noticed the message SQL DISABLED,,, well you just need to add 'enableProfiling'=>'true' in the DB configuration in
protected/config/main.php
'db'=>array(
config.... 'enableProfiling'=>'true' ),
It will work.
Nice extension by the way
Regards,
Diego
Thumbs up!
Good work man, this is clean simple and really useful!
I found a bug
First I'd like to say fine job! Ok, now to the bug.
If you take a stock Yiic generated yii app, include your extension, and delete your 'db' in the main config.php you'll cause a null in your extension. It was messing up my theme in the rest environment, it took me an hour to figure it out lol.
Anyways, keep up the great work, I really do like this extension.
Disable rendering for AJAX requests
Cool extension. But it should not output anything on AJAX requests (or at least allow this as configuration option).
Could you maybe fix this?
New update
Better and better.
Congratulations to the developer and thank you.
New version
Piece of art ;) Very useful, Thanks.
Спасибо, Роман!
Thanks to all
My name is not Roman, my name is Sergey ))
Special thanks to Roman Revin for Russian translation and an man page on HabraHabr.
Thanks
Thanks to you two, in a way ;)
Errors in last version
I receive error in last version
Controller SiteController can't find view "index"
when tries to open index page of site with this extension installed.
I'm using Twig as views renderer and extension of views files is ".twig".
@Nafania - Issue with Twig has fixed
Please check latest version on GitHub
https://github.com/malyshev/yii-debug-toolbar/issues/34
levels is missing
Hey,
Thanks for this great extension, however I am missing the levels set up in the config. (ex: 'levels' => 'info'). I found in YiiDebugToolbarRoute.php's init method this:
$this->levels='';
$this->categories='';
It means it logs everything. It would be nice of we can configure this from the config.
Thanks!
Great plugin - requires fix for multiple databases
Hello,
I'd like to suggest a code improvement that resolves an issue with showing the database connection details. In the file 'YiiDebugToolbarPanelSql.php', on line 211, it looks like this:
$lines = explode(' ', $serverInfo); foreach($lines as $line) { list($key, $value) = explode(': ', $line, 2); $info[YiiDebug::t($key)] = $value; }
In order for this to work with multiple databases, I made the following change:
if (is_array($serverInfo)): foreach($serverInfo as $key => $value) { $info[YiiDebug::t($key)] = $value; } else: $lines = explode(' ', $serverInfo); foreach($lines as $line) { list($key, $value) = explode(': ', $line); $info[YiiDebug::t($key)] = $value; } endif;
This ensures that if the $serverInfo is from multiple databases, it's all added correctly.
error for web service controllers
this is a great extension. however, it breaks a web service i am running from my site. The error I get is 'Extra content at the end of the document'. The extension is presumably sending out the debug content on web service requests, which creates invalid xml. is there any way to disable it in the controller or config settings for that controller?
How to use it?
I can follow the instruction to install it. But how to bring out the window showed above?
Is it in firefox?
I am confused~~~
how to use
Hi nettrinity,
Do you enable debugging in your index.php file???
Slick
Thanks for this extension. Very useful.
Disable
Is there a possibility to disable the toolbar for a specific action?
i don't see
how can i see the toolbar??
i follow the instruction, but how can i read into the toolbar?
thanks!
Re: I don't see
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.
Temporarily disable the output of debug info
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...
Disable with "exit"
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.
Workaround verified
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):
Yii::app()->request->sendFile("taxo.json",json_encode($dump, true),'text/plain', false); exit();
Just don't use the $terminate option of the sendFile and rudely call exit() yourself after sending the file...
yii-debug-toolbar with Web Service
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
protected function onBeginRequest(CEvent $event) { $route = Yii::app()->getUrlManager()->parseUrl(Yii::app()->request); $this->enabled = (preg_match('#^(?:services|test)/#',$route) == 0); $this->getToolbarWidget() ->init(); }
The best yii debugger extension
This debugger is way better than others I have seen in yii extension lib...
Not displaying...
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...
:-/
About not seeing the plugin...
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.
re: not displaying
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?
re: not displaying
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...
Great extension
The only feature i'm missing right now is ability to set levels in config.
How to use result window of this extension ?
I am not getting any instruction to use this extension.
Please help.
thanks
RE: How to use result window of this extension ?
What exactly you mean?
Page load time vs Elapsed time
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. :)
> RE: Page load time vs Elapsed time
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
additionalPanels -- bug?
I have my config set like this:
array( 'class'=>'ext.yii-debug-toolbar.YiiDebugToolbarRoute', 'additionalPanels'=>array('ext.sample.YiiDebugToolbarPanelSample'), ),
YiiDebugToolbarRoute tries to call YiiDebugToolbar->appendPanel() ... but that doesn't exist. Are additionalPanels not supported? Or were appendPanel and prependPanel accidentally left out?
Thanks!
Why always load jquery?
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
Yii::app()->getClientScript()->registerCoreScript('jquery');
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!
@Stratigos
The function itself already has condition to check jquery including status.
Yii::app()->getClientScript()->registerCoreScript('jquery');
SQL Queries
When I click on SQL option I get this message:
No SQL queries were recorded during this request or profiling the SQL is DISABLED.
How can I enable SQL?
SQL queries
@elyaqui
You nedd two additional setings in the "db" component in config.php. Otherwise the SQL panel has no data to display.
'db'=>array( .... 'enableProfiling'=>true, 'enableParamLogging'=>true,
Will it work with Yii 1.1.3?
Hello,
I was wondering if it will work with 1.1.3, and if not, what could be done to make it compatible.
My production website is running 1.1.3 so I'd like to use it without updating Yii at the moment.
I will give it a try anyway when I can and see if it works.
Regards!
How to make compatible with another View Renderer such as Smarty
If you want to make this extension compatible with another view renderer that uses a different file extension, such as Smarty, simply edit components/YiiDebugViewRenderer::getFileExtension() by adding this to the top:
if ($this->_instance !== null) $this->_fileExtension = $this->_instance->fileExtension;
I hope this helps.
its not working for me....
i've configured it as showen above but its still not working working for me ....
Need help?
@vijaykoogu
Can you paste your configuration so one of us can help identify the issue?
How to use yii-debug-toolbar ?
How to use yii-debug-toolbar ?
-coz i configured it as it has been showen in the extension page..
'log'=>array(
'class'=>'CLogRouter',
'routes'=>array(
array(
'class'=>'ext.yii-debug-toolbar.YiiDebugToolbarRoute',
// 'ipFilters'=>array('127.0.0.1','192.168.1.215'),
),
),
),
I have disabled the "ipFilters" as im working on localhost and i ahve added
'db'=>array(
'connectionString' => 'mysql:host=localhost;dbname=test',
//...
'enableProfiling'=>true,
'enableParamLogging'=>true,
),
but no sucess... :(
Need help?
@vijaykoogu,
It would help if you wrapped your code sample using the "Code Block" to make it easier for us to read your code.
It would also help if you pasted your entire configuration file (excluding the private stuff, of course). I can't tell if you just copied and pasted the code that's described in the Usage and Configuration section above.
Where did you extract your files to? Can you confirm that the extension was extracted to /protected/extensions/yii-debug-toolbar/? Within that path, do you see the directories, such as assets, components, panels, etc, as well as the files YiiDebug.php, YiiDebugToolbar.php, etc? Did you by mistake extract the files as /proctected/extensions/yii-debug-toolbar-20111202/yii-debug-toolbar/?
When you said you disabled ipFilters, how exactly did you do this?
In your case, if your Web Server is on the same machine that you're developing on, then the configuration in the example above should work if you placed the files in the correct directories.
'log'=>array( 'class'=>'CLogRouter', 'routes'=>array( array( 'class'=>'ext.yii-debug-toolbar.YiiDebugToolbarRoute', 'ipFilters'=>array('127.0.0.1'), ), ), ),
However, if your Web Server is on a different box (or virtual instance if you're using something like VMWare or Virtual Box), then you'll need to enter the IP of your machine where you are browsing from or use * to include everything in a particular subnet.
'routes'=>array( array( 'class'=>'ext.yii-debug-toolbar.YiiDebugToolbarRoute', 'ipFilters'=>array('192.168.0.*'), ), ),
Now to really test if your files are in the correct location and to ensure that the issue is not configuration-related, you can use the following, but I would advise that you enter specific IP address(es) and not use a catch-all setup such as the following.
'routes'=>array( array( 'class'=>'ext.yii-debug-toolbar.YiiDebugToolbarRoute', 'ipFilters'=>array('*'), ), ),
Also, both enableProfiling and enableParamLogging are not needed to use this extension. They will help once you can get the toolbar to display as you will be able to see the SQL statements and named parameters. Before trying to get that working, try to get the extension working first.
Good luck.
it works for me now...
Thanks a lot brother, it works for me now... well i dint do anything just added same code as shown above for configuration in main.php file. thanks a lot
Great work!
Hi, this helps a lot during development.
I would like to add some feature requests that will increase the level of security:
Restrict to a certain userid (instead of the IpFilters or in combination with this)
Option to choose to display the toolbar to users/guests/both
keep up the good work.
Illegal string offset 'class'
I'm using PHP 5.4.6 and I'm getting the following error:
PHP warning Illegal string offset 'class' /home/.../protected/extensions/yii-debug-toolbar/YiiDebugToolbar.php(168) 156 157 /** 158 * Create panels. 159 * 160 * @return YiiDebugToolbar 161 */ 162 private function createPanels() 163 { 164 foreach ($this->getPanels() as $id => $config) 165 { 166 if (!is_object($config)) 167 { 168 isset($config['class']) || $config['class'] = $id; 169 $panel = Yii::createComponent($config, $this); 170 171 if (false === ($panel instanceof YiiDebugToolbarPanelInterface)) 172 { 173 throw new CException(Yii::t('YiiDebugToolbar', 174 'The %class% class must be compatible with YiiDebugToolbarPanelInterface', array( 175 '%class%' => get_class($panel) 176 ))); 177 } 178 $panel->init(); 179 $this->_panels[$id] = $panel; 180 }
On PHP 5.3 all worked fine.
Possible fix for 5.4+
@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:
is_array($config) || $config = []; isset($config['class']) || $config['class'] = $id;
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.
Handy Tool But It Breaks One of My Pages
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.
Any JS errors
Did you check for JS errors? Are you using a debbuger like firebug?
Yep
Yes I checked it and I have an HTML validation error which says I'm missing a /div.
Can't install :(
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 ! ;)
Error fix
@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.
No
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
Could you provide a configuration that you use for this widget?
Well...
@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:
private function createPanels() { /**Create panels. @return YiiDebugToolbar */ foreach($this->getPanels() as $id=> $config) { if(!is_object($config)) { if(is_array($config)) { isset($config['class'])||$config['class']=$id; if(isset($config['enabled'])&&false===$config['enabled']) { unset($this->_panels[$id]); continue; } else if(isset($config['enabled'])&&true===$config['enabled']) { unset($config['enabled']); } } $panel=Yii::createComponent($config, $this); if(false===($panel instanceof YiiDebugToolbarPanelInterface)) { throw new CException(Yii::t('yii-debug-toolbar', 'The %class% class must be compatible with YiiDebugToolbarPanelInterface', array( '%class%'=>get_class($panel)))); } $panel->init(); $this->_panels[$id]=$panel; } } return $this; }
EDIT: The only difference is that we've wrapped a portion of the code in an if(is_array()) block.
@jurrasic82
Try to download and use latest version from GitHub
yes!
thanx krowe ! that is working :)
Is it still working ?
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
Enabling Profiling for SQL
Enable SQL logging in your configuration...
'db' => array( 'enableProfiling' => true, 'enableParamLogging' => true ),
As a side note, this works GREAT with the yii-environment extension.
Working, and great, great, great !!!!
Thanks, all is working and this extensions is really a must have
Gateways, Load Balancers, Etc.
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:
$headers = apache_request_headers(); $ip = $headers['X-Forwarded-For']; if (empty($ip)) $ip = (isset($_SERVER['REMOTE_ADDR'])) ? $_SERVER['REMOTE_ADDR'] : '127.0.0.1';
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 a lot!
Great work!
Log execution time not run time
Is it possible to show the function execution time? I eam END-START= time? Because there is only the START time.
Illegal String Offset
@m00nk ,
Did you find the solution to it? I am also having the same illegal offset error.
Let me know.
Ajax update
Is it possible to get the log from the ajax requests ?
AJAX response
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.
Broken code in
DO NOT DOWNLOAD CODE FROM DOWNLOAD MENU ON THE RIGHT SIDE OF THIS PAGE, USE GITHUB REPOSITORY INSTEAD!
I spend hours to reveal the former code is damaged!
Can't see the debug panels
I have installed the extension, but I can't see any debug panels.. Can anyone help please?
Blinking Panel
First thanks for the extension, is very useful. I have some kind of bug, when i hover elements in the opened panel, the sidebar is blinking (show/hide very fast). How can i fix that? Hover in SQL between Callstack and Server.
Session getting destroyed after redirects
I just updated to the latest version, and noticed that whenever I redirect, my session gets destroyed. When I disable the debugger, everything works fine.
I just wanted to give you a heads up and thank you for the nice update.
Session woes part deux
My app continues to work fine when I disable the Session Attributes Request Panel. I'm baffled why this is happening. I even tried editing YiiDebugToolbarPanelRequest::run() as follows, but no dice:
public function run() { if (session_id() !== '') { $this->render('request', array( 'server' => $_SERVER, 'cookies' => $_COOKIE, 'session' => isset($_SESSION) ? $_SESSION : null, 'post' => $_POST, 'get' => $_GET, 'files' => $_FILES, )); } }
So for now, I'm going to have to live without using the Session panel.
Great!
Very very nice!!!
I develop the logging panel and add duration column with color mode for it.
I develop the logging panel and add duration column with color mode for it.
This is here: https://github.com/NabiKAZ/yii-debug-toolbar
Please review it and marge it on master project if you want.
Very fancy
Thank you. It's very fancy and useful! (y)
New panel - cache usage
Cache usage panel shows settings, stats and callstack for cache component
Russian description of cache panel for yii-debug-panel
github.com: yii-debug-panel fork with cache panel
THANK YOU!
BEST YII EXTERNSION!
not working
it not working for me,
this my config
array( 'class'=>'ext.yii-debug-toolbar.YiiDebugToolbarRoute', 'ipFilters'=>array('127.0.0.1','192.168.1.215'), ),
Wow
Very Beautiful.
I'm amazed
Question about config
Hi and thanks for a beautiful extension. This was good now it is also Beautiful :)
I just wanted to know if it is possible to select what I want to be tracked if it is Queries or Log and so forth.
Thanks again
How to switch off toolbar in some cases, from code or config?
I'd like, for example, to not show the toolbar for
Content-type: application/json
responses.How would I do this?
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.