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 ¶
- See PHP Console presentation video.
- Install Google Chrome extension PHP Console.
- See how it works on live demo page.
- PHP Console extension features and screenshots.
- PHP Console server library features list.
Requirements ¶
- Yii Framework v1.* project
- PHP > 5.3
- Install Google Chrome extension "PHP Console"
- Set output_buffering setting to true in php.ini (optional)
Installation ¶
- Download php-console Yii extension
- Copy "/src/extension/phpconsole" to your extensions directory (i.e. /protected/extensions).
- Copy "/src/vendors/PhpConsole" to your vendors directory (i.e. /protected/vendors).
- 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;
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!
fun
Looks fun; I'll test it now!!
Good work
Nice job, thank you!
Only error logged
Hello
By this default config, only errors logget into phpconsole. No db profiling, no debug messages. any idea?
Great work!
Thanks for sharing.
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.