![]() |
|
stPhpConsolePlugin |
|
![]() |
7
users
Sign-in
to change your status |
The stPhpConsolePlugin integrates Symfony Framework with Google Chrome extension "PHP Console" and PhpConsole class.
PhpConsole catches all kind of errors/exceptions/debug messages and sends them to Google Chrome extension PHP Console, that displays them in Google Chrome console or by notification popups.
Install plugin package
php symfony plugin:install /path/to/local/stPhpConsolePlugin-1.0.1.tgz
Enable it in "config/ProjectConfiguration.class.php"
class ProjectConfiguration extends sfProjectConfiguration
{
public function setup()
{
$this->enablePlugins('stPhpConsolePlugin');
}
}
Copy "/plugins/stPhpConsolePlugin/config/php_console.yml" to "/PROJECT/config/" and check how it's configured.
Test this code in some controller:
// generate some Symfony events with names [sql, debug] described in config
sfContext::getInstance()->getEventDispatcher()->notify(new sfEvent('SELECT * FROM users', 'sql'));
sfContext::getInstance()->getEventDispatcher()->notify(new sfEvent('Debug test message', 'debug'));
sfContext::getInstance()->getEventDispatcher()->notify(new sfEvent('This message will not be catched', 'debug.post'));
// generate PhpConsole debug message and some errors
debug('There is a short way to debug by PhpConsole debug() function', 'any,tags');
file_get_contents('this_will_generate_E_WARNING');
throw new Exception('This exception will be catched by PhpConsole');
Thanks for your feedback and bug reporting.