Yii 1.1: php-console

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

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

PHP Console allows you to handle PHP errors & excepions, dump variables, execute PHP code remotely and many other things using Google Chrome extension PHP Console and PHP Console server library.

Overview

Google Chrome extension "PHP Console" screen

Google Chrome extension "PHP Console" screen

Google Chrome extension "PHP Console" screen

Requirements

Installation

  1. Download php-console Yii extension
  2. Copy "/src/extension/phpconsole" to your extensions directory (i.e. /protected/extensions).
  3. Copy "/src/vendors/PhpConsole" to your vendors directory (i.e. /protected/vendors).
  4. Modify your config file (i.e. /protected/config/main.php)
// ....
 
    'preload' => array('log'),
 
    'components' => array(
 
        'log' => array(
            'class' => 'CLogRouter',
            'routes' => array(
                'class' => 'ext.phpconsole.PhpConsoleLogRoute',
                /* Default options:
                'isEnabled' => true,
                'handleErrors' => true,
                'handleExceptions' => true,
                'sourcesBasePath' => $_SERVER['DOCUMENT_ROOT'],
                'phpConsolePathAlias' => 'application.vendors.PhpConsole.src.PhpConsole',
                'registerHelper' => true,
                'serverEncoding' => null,
                'headersLimit' => null,
                'password' => null,
                'enableSslOnlyMode' => false,
                'ipMasks' => array(),
                'dumperLevelLimit' => 5,
                'dumperItemsCountLimit' => 100,
                'dumperItemSizeLimit' => 5000,
                'dumperDumpSizeLimit' => 500000,
                'dumperDetectCallbacks' => true,
                'detectDumpTraceAndSource' => true,
                'isEvalEnabled' => false,
                */
            )
        )
    )
 
    // ...

Usage

Try this code in some controller:

// log using Yii methods
Yii::log('There is some debug message');
 
// log using PHP Console debug method
PC::debug('Short way to debug directly in PHP Console', 'some,debug,tags');
echo $undefinedVar;

Resources

Total 4 comments

#16588 report it
Stageline at 2014/03/08 12:02pm
Only error logged

Hello

By this default config, only errors logget into phpconsole. No db profiling, no debug messages. any idea?

#13282 report it
Stageline at 2013/05/20 10:40am
Good work

Nice job, thank you!

#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