Skip to content
Debug bar for PHP
PHP JavaScript CSS HTML
Branch: master
Clone or download

Latest commit

VictorDauchy and vdauchy Add return value to measure() function. (#443)
Change-Id: I0e0277a019545bae6b4a9854b915a83bcea6757a

Co-authored-by: vdauchy <vdauchy@summit-tech.ca>
Latest commit 1a1605b May 6, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
build Update FA to 4.5 Dec 10, 2015
demo Deprecate TwigCollector and friends (#425) Oct 9, 2019
docs Fetch documentation (#438) Feb 29, 2020
src/DebugBar Add return value to measure() function. (#443) May 6, 2020
tests Add return value to measure() function. (#443) May 6, 2020
.bowerrc Update bower deps Jul 21, 2017
.gitattributes Tweak FA namespacing Dec 10, 2015
.gitignore removed unneeded files in vendor assets Mar 23, 2014
.travis.yml Update .travis.yml Oct 18, 2019
CHANGELOG.md Update changelog Jan 3, 2015
CONTRIBUTING.md Whitespace cleanup Jul 26, 2014
LICENSE huge refactoring, comments and docs Jun 13, 2013
README.md Add link to TYPO3 integration (#378) Apr 9, 2018
bower.json Update jQuery to v3 May 12, 2018
composer.json Symfony 5 support added (#431) Nov 24, 2019
phpunit.xml.dist Fixed the tests Oct 27, 2014

README.md

PHP Debug Bar

Latest Stable Version Total Downloads License Build Status

Displays a debug bar in the browser with information from php. No more var_dump() in your code!

Screenshot

Features:

  • Generic debug bar
  • Easy to integrate with any project
  • Clean, fast and easy to use interface
  • Handles AJAX request
  • Includes generic data collectors and collectors for well known libraries
  • The client side bar is 100% coded in javascript
  • Easily create your own collectors and their associated view in the bar
  • Save and re-open previous requests
  • Very well documented

Includes collectors for:

Checkout the demo for examples and phpdebugbar.com for a live example.

Integrations with other frameworks:

(drop me a message or submit a PR to add your DebugBar related project here)

Installation

The best way to install DebugBar is using Composer with the following command:

composer require maximebf/debugbar

Quick start

DebugBar is very easy to use and you can add it to any of your projects in no time. The easiest way is using the render() functions

<?php

// Require the Composer autoloader, if not already loaded
require 'vendor/autoload.php';

use DebugBar\StandardDebugBar;

$debugbar = new StandardDebugBar();
$debugbarRenderer = $debugbar->getJavascriptRenderer();

$debugbar["messages"]->addMessage("hello world!");
?>
<html>
    <head>
        <?php echo $debugbarRenderer->renderHead() ?>
    </head>
    <body>
        ...
        <?php echo $debugbarRenderer->render() ?>
    </body>
</html>

The DebugBar uses DataCollectors to collect data from your PHP code. Some of them are automated but others are manual. Use the DebugBar like an array where keys are the collector names. In our previous example, we add a message to the MessagesCollector:

$debugbar["messages"]->addMessage("hello world!");

StandardDebugBar activates the following collectors:

  • MemoryCollector (memory)
  • MessagesCollector (messages)
  • PhpInfoCollector (php)
  • RequestDataCollector (request)
  • TimeDataCollector (time)
  • ExceptionsCollector (exceptions)

Learn more about DebugBar in the docs.

You can’t perform that action at this time.