[EXTENSION] Yii Debug Toolbar (1.0.x version)

This extension is very useful in the development stage of project. It helps you to get info about PHP environment, application, queries logs, benchmarking with a simple little toolbar at the top of the page.

It is a recreated Symfony’s developer toolbar.

First idea and very first implementation was my, but this version mostly implemented by Eduard Kuleshov.

This version tested for 1.0.x branch of Yii Framework.

Work for 1.1 branch is doing (maybe it will need to full rewrite code).

You can download it from these places:

generally it works on 1.1.0

under php5.3 requires some minor modifications.

Which modifications we need to make to work this extension on the PHP 5.3? You can send me to "kuznecov.sg@gmail.com" and I can commit it to code.google.com.

Hello,

Congratulations, excelent extension, I’ve tested with Yii 1.1.0 and PHP 5.3 and it’s working like a charm. No problems 'til now.

Gr8 extension.

Thanks!

Hmm…

That’s sounds like I am the only one looser! :) On my Mac OS X 10.6.2, Apache/2.2.14 (Unix), PHP 5.3.1 I have an error:


Fatal error: Class 'CErrorEvent' not found in /Users/cr0t/Workspace/com.site/protected/extensions/yiidebugtb/XWebDebugRouter.php on line 251

I think that it could be possible because of late static binding in PHP 5.3, but I’m not sure.

This is great!

The ‘CErrorEvent’ error is caused by some PHP strict notices. For example,

formatArrayAsHtml and yiiAppAsArray are called statically while they are not declared so.

Also, CLogRoute::collectLogs() signature is changed in Yii 1.1.

Thank you very much! I’m proud that project leader says this words about this little extension! :)

Thank you very-very-very much! You show me the right way to solve this task! There are was few problems like these:




macdi:yiidebugtb cr0t$ php XWebDebugRouter.php 

PHP Strict Standards:  Declaration of yiiDebugDB::getInfo() should be compatible with that of yiiDebugClass::getInfo() in /Users/cr0t/Workspace/com.site/protected/extensions/yiidebugtb/XWebDebugRouter.php on line 251


Strict Standards: Declaration of yiiDebugDB::getInfo() should be compatible with that of yiiDebugClass::getInfo() in /Users/cr0t/Workspace/com.site/protected/extensions/yiidebugtb/XWebDebugRouter.php on line 251

PHP Strict Standards:  Declaration of yiiDebugTrace::getInfo() should be compatible with that of yiiDebugClass::getInfo() in /Users/cr0t/Workspace/com.site/protected/extensions/yiidebugtb/XWebDebugRouter.php on line 272


Strict Standards: Declaration of yiiDebugTrace::getInfo() should be compatible with that of yiiDebugClass::getInfo() in /Users/cr0t/Workspace/com.site/protected/extensions/yiidebugtb/XWebDebugRouter.php on line 272

PHP Strict Standards:  Declaration of yiiDebugTime::getInfo() should be compatible with that of yiiDebugClass::getInfo() in /Users/cr0t/Workspace/com.site/protected/extensions/yiidebugtb/XWebDebugRouter.php on line 284


Strict Standards: Declaration of yiiDebugTime::getInfo() should be compatible with that of yiiDebugClass::getInfo() in /Users/cr0t/Workspace/com.site/protected/extensions/yiidebugtb/XWebDebugRouter.php on line 284

PHP Strict Standards:  Declaration of yiiDebugMem::getInfo() should be compatible with that of yiiDebugClass::getInfo() in /Users/cr0t/Workspace/com.site/protected/extensions/yiidebugtb/XWebDebugRouter.php on line 297


Strict Standards: Declaration of yiiDebugMem::getInfo() should be compatible with that of yiiDebugClass::getInfo() in /Users/cr0t/Workspace/com.site/protected/extensions/yiidebugtb/XWebDebugRouter.php on line 297

PHP Fatal error:  Class 'CLogRoute' not found in /Users/cr0t/Workspace/com.site/protected/extensions/yiidebugtb/XWebDebugRouter.php on line 439


Fatal error: Class 'CLogRoute' not found in /Users/cr0t/Workspace/com.site/protected/extensions/yiidebugtb/XWebDebugRouter.php on line 439



But I can see they only when try to run from command line (apache logs was not so talkative :( ).

I’m commit fixes to code.google.com project and also update downloads section at the extensions.

Now it working with Yii 1.1 and PHP 5.3 without errors.

Extension updated:

Fixed horizontal scroll, removed borders from yiidebugpanel, fixed fonts for yiidebugpanel.

You could download fixed version here: http://www.yiiframework.com/extension/yiidebugtb/files/yiidebugtb-1.0.x-1.1.x-bordersfix.tar.gz

Hello,

Is it possible to change position of the toolbar e.g. to bottom, right, left?

I have couple toolbars and need to fit both :)

Thanks,

CoLT

Great extension! Good work. :)

This is really good. I’m using it

One thing I noticed in the docs is that it says to include the application.extensions.yiidebugtb.* in the autoload config. You actually do not need to do this if you simply directly reference the XWebDebugRouter class in the config like so:




					array(

						'class'=>'application.extensions.yiidebugtb.XWebDebugRouter',

						'config'=>'alignLeft, opaque, runInDebug, fixedPos, collapsed, yamlStyle',

						'levels'=>'error, warning, trace, profile, info',

					),

Thank you for your work, it’s working flawlessly.

Hi all,

I am new at yii, basically new at any framework in php. I cannot get the yiidebugtb to work. I have followed all the instructions but am still not able to see the dialog box.

details

PHP Version 5.3.1

yii-1.1.5

yiidebug-1.0.x-1.1.x-trace-fix

Kindly help me. I dont know what I am missing

Regards,

Sarfraz

As you wrote that you are new… have you created a new webapp with yiic?

If you did… can you post here your config… (protected/config/main.php)

Suggestion: In the array of allowedIPs add also the ::1 ipv6 address assigned to localhost. Had to dump the $app->request->getUserHostAddress() from inside the extension to check why i couldn’t see the toolbar.

So, if anyone face problems seeing the toolbar try adding ::1 to this list.

Cheers

I have enabled the extension, but i dont see nothing on my page.

How to use it?

Did you configure allowIPs array in the config file? And if you did that and don’t see anything at all, check your local ip address (check previous to yours post in this thread).

Hi! Can you add info from the code below? (CDbConnection#getStats)


CDbConnection::getStats()

And maybe some more info about DB?

Thanks in advance

Found a small bug in the sessionAsArray() function.

At the moment the session detail outputs the session Data keys with one missing letter at the start of the session key




PHP:

  Key: 'd02e100655545c339f4ff0fb76506e2'

  Data: 	

      _id: '1' // should be __id

      _name: 'kokomo' // should be __name

      eg_date: '2011-01-16 23:41:38' // should be reg_date






public static function sessionAsArray()

...

 foreach ($_SESSION as $key=>$value)

 {

   if (is_null($sessKeyLen))

   {

	$values['PHP']['Key'] = substr($key, 1, strpos($key, '_')-1);

	// actual code

	//sessKeyLen = strlen($values['PHP']['Key'])+2;

	// correct code

	sessKeyLen = strlen($values['PHP']['Key'])+1; // +1 instead of +2

   }

   $phpSession[substr($key, $sessKeyLen)] = $value;

 }

...



Sorry that I post the bug here but I don’t use GitHub so I don’t have an account.

Thank you, fixed.