2017 © Pedro Peláez
 

library silex-chromephp

Silex package to implement ChromePHP as ServiceProvider

image

blackmesasl/silex-chromephp

Silex package to implement ChromePHP as ServiceProvider

  • Saturday, February 8, 2014
  • by Blackmesa
  • Repository
  • 3 Watchers
  • 1 Stars
  • 8 Installations
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

SilexChromePhp

Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

SilexChromePhp is a wrapper around ccampbell/chromephp (https://github.com/ccampbell/chromephp) library that allows to debug PHP applications with the Chrome Logger Google Chrome extension., (*2)

The ChromePhpServiceProvider easily integrate ChromePhp into Silex Micro Framework (http://silex.sensiolabs.org), (*3)

Installation

SilexChromePhp and ChromePhp

Add blackmesasl/silex-chromephp to your dependencies., (*4)

Via command line:, (*5)

php composer.phar require "blackmesasl/silex-chromephp":"dev-master", (*6)

or adding the following line to your composer.json file:, (*7)

"blackmesasl/silex-chromephp": "dev-master", (*8)

and running php composer.phar update, (*9)

Chrome Logger Extension

To be able to see the debug messages you send from your server side code you need to install the Chrome Logger Extension from the Chrome Web Store., (*10)

Once you have the service provider on you Silex project and the extension installed on your Chrome Browser just enable the extension to start getting your debugging information on the console panel of the Developer Tools., (*11)

For more information take a look of Chrome Logger website., (*12)

Usage

Import the namespace and register the ServiceProvider on your Silex application:, (*13)

use Blackmesa\SilexChromePhp\Provider\ChromePhpServiceProvider;

$app->register(new ChromePhpServiceProvider());

Now you can access to $app['chromephp'] object and call it's methods., (*14)

Available methods

  • info
  • warn
  • error
  • log
  • table
  • group
  • groupCollapsed
  • groupEnd
$app->get('/myroute', function() use ($app) {
    try
    {
        $app['chromephp']->info('Let\'s render the view!'); 
        return $app['twig']->render('mytemplate.html.twig');
    }
    catch(Exception $e)
    {
        $app['chromephp']->error($e);
        throw $e;
    }
    $app['chromephp']->warn('This is impossible!!!');
});

The ChromePhpServiceProvder make use of $app['debug'] flag to decide whether or not to send de info to the browser., (*15)

See also

The Versions

08/02 2014

dev-master

9999999-dev http://github.com/blackmesasl/silex-chromephp

Silex package to implement ChromePHP as ServiceProvider

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Blackmesa

silex serviceprovider chromephp

08/02 2014

0.1.0

0.1.0.0 http://github.com/blackmesasl/silex-chromephp

Silex package to implement ChromePHP as ServiceProvider

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Blackmesa

silex serviceprovider chromephp