itkg/debug

Itkg debug library

dev-master 2014-10-24 08:14 UTC

This package is not auto-updated.

Last update: 2024-11-05 04:08:03 UTC


README

Build Status Scrutinizer Code Quality Code Coverage

Debug library with custom debug bar

Installation

Installation by Composer

If you use composer, add itkg/debug as a dependency to the composer.json of your application

    "require": {
        ...
        "itkg/debug": "dev-master"
        ...
    },

To install assets in your web directory with composer, you can add this lines :

    "extra": {
        "itkg_debug_asset_dir": "path/to/your/web/directory"
    },
    "scripts": {
        "post-update-cmd":  "Itkg\\Debug\\Composer\\Installer::copyAssets",
        "post-install-cmd": "Itkg\\Debug\\Composer\\Installer::copyAssets"
    }

Usage

For documentation & default data collector, read php-debugBar documentation.

To activate debug bar :

    ... // include autoload, etc
    $container = new Itkg\Core\ServiceContainer();
    $container->register(new Itkg\Debug\ServiceProvider());

    $debugBarRenderer = $container['debug']['renderer'];

    // include scripts header
    echo $debugBarRenderer->renderHead();

    // include debug bar
    echo $debugBarRenderer->render();