snapshotpl/zf-snap-php-debug-bar

PHP Debug Bar module for Zend Framework 2

Installs: 1 341

Dependents: 0

Stars: 15

Watchers: 2

Forks: 1

Open Issues: 1

Language: PHP

0.9.2 2015-04-22 20:44 UTC

README

PHP Debug Bar module for Zend Framework 2

Version 0.9.0 Created by Witold Wasiczko

PHP Debug Bar Messages

How to install?

By composer.json

{
    "require": {
        "snapshotpl/zf-snap-php-debug-bar": "dev-master"
    }
}

run composer update and add module ZfSnapPhpDebugBar to ZF2 application.config.php.

You need also copy all files from vendor/maximebf/debugbar/src/DebugBar/Resources/ into public/DebugBar/Resources/.

Features

  • All PHP Debug Bar features + additional info about ZF2 application:
    • Log and debug directly to Debug Bar,
    • Check request variables ($_POST, $_GET, $_SERVER, $_COOKIE),
    • Use timeline to see time between common events,
    • Catch exceptions,
    • Preview config and application config,
    • Profile SQL queries,
    • Details about current route,
    • Memory usage,
    • Total request duration,
    • and more...!
  • Ready to use - just install via composer.json!
  • easy configurable via module config,

How to use Message tab?

By function:

debugbar_log('ZfSnapPhpDebugBar is awesome!');

By static method:

\ZfSnapPhpDebugBar\Module::log('ZfSnapPhpDebugBar is awesome!');

By Zend\Log:

$writer = $sm->get('ZfSnapPhpDebugBar\Log\Writer\PhpDebugBar');
$log = new \Zend\Log\Logger();
$log->addWriter($writer);
$log->info('ZfSnapPhpDebugBar is awesome!');

Directly by DebugBar object from ServiceManager:

$debugbar = $sm->get('debugbar');
$debugbar['messages']->addMessage('ZfSnapPhpDebugBar is awesome!'));

How to config?

Overwrite module config:

<?php

return array(
    'php-debug-bar' => array(

        // Enables/disables PHP Debug Bar
        'enabled' => true,

        // ServiceManager keys to inject collectors
        // http://phpdebugbar.com/docs/data-collectors.html
        'collectors' => array(),

        // ServiceManager key to inject storage
        // http://phpdebugbar.com/docs/storage.html
        'storage' => null,
    ),
);

PHP Debug Bar Timeline

PHP Debug Bar Request

PHP Debug Bar Config

PHP Debug Bar Route