stPhpConsolePlugin

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to the Plugins Home

Stats

Plugin Information Installation
stPhpConsolePlugin
Plugin image

stPhpConsolePlugin

Overview

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.

Requirements

Installation

  1. Install Google Chrome extension PHP Console

  2. Download plugin archive

  3. Install plugin package

    php symfony plugin:install /path/to/local/stPhpConsolePlugin-1.0.1.tgz
    
  4. Enable it in "config/ProjectConfiguration.class.php"

    class ProjectConfiguration extends sfProjectConfiguration
    {
      public function setup()
      {
            $this->enablePlugins('stPhpConsolePlugin');
      }
    }
    
  5. Copy "/plugins/stPhpConsolePlugin/config/php_console.yml" to "/PROJECT/config/" and check how it's configured.

  6. 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');
    

Feedback

Thanks for your feedback and bug reporting.