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

// .... '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']) ) ) ) ) // ...
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');
Total 2 comments
Looks fun; I'll test it now!!
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 login to leave your comment.