php-console

Integrate Yii with Google Chrome extension "PHP Console"
16 followers

This extension integrates Yii with Google Chrome extension "PHP Console" and PhpConsole class.

Google Chrome extension "PHP Console" screen

Requirements

Installation

  1. Download php-console Yii extension and extract the "phpconsole" folder to your extensions directory (i.e. /protected/extensions).
  2. Modify your config file (i.e. /protected/config/main.php)
// ....
 
    'preload' => array('log'),
 
    'components' => array(
 
        // ...
 
        'log' => array(
            'class' => 'CLogRouter',
            'routes' => array(
                array(
                    'class' => 'ext.phpconsole.PhpConsoleYiiExtension',
                    'handleErrors' => true,
                    'handleExceptions' => true,
                    'basePathToStrip' => dirname($_SERVER['DOCUMENT_ROOT'])
                )
            )
        )
    ) 
 
    // ...

Usage

Try this code in some controller:

// log using Yii methods
Yii::log('There is some error', CLogger::LEVEL_ERROR, 'app,context');
Yii::log('There is some warning', CLogger::LEVEL_WARNING);
Yii::log('There is some debug message', CLogger::LEVEL_INFO);
 
// log using PHP Console debug method
debug('Short way to debug directly in PHP Console', 'some,debug,tags');
echo $test_E_NOTICE;
throw new Exception('There is some not catched exception');

Resources

Total 2 comments

#6954 report it
yiimann at 2012/02/15 12:15pm
fun

Looks fun; I'll test it now!!

#3891 report it
JFReyes at 2011/05/18 05:16am
Good work!

The extension helped me out right on its first use to find a stray <?php tag buried in an auxiliary view that wouldn't allow the layout to display. Thanks!

Leave a comment

Please to leave your comment.

Create extension