Experimental project
This is a sandbox project, which contains experimental code for developer use only.
Debugging in Drupal has never been easier
Debug Bar displays a debug bar in the browser with information from PHP using PHP Debug Bar.
No more var_dump() in your code!
Requirements
- Composer (in order to locally install PHP Debug Bar)
Installation
- Download the module as usual - don't enable it yet
- cd to the module directory
- Install PHP Debug Bar:
$ php composer.phar install
- Enable the module
The Debug Bar should now appear in the bottom area of the website.
Notice
Since this is still a sandbox project, download it with Git
$ git clone --branch master http://git.drupal.org/sandbox/jfhovinne/2132181.git debug_bar
Usage
Message log
In order to inspect a variable, log a message, etc, use debug_bar_add_message
in your code.
global $user;
debug_bar_add_message($user);
Get the debug bar instance and display exceptions
$debugbar = debug_bar_get_instance();
try {
throw new Exception('foobar');
} catch (Exception $e) {
$debugbar['exceptions']->addException($e);
}
More info
PHP Debug Bar
See PHP Debug Bar documentation for available features.
Composer installation
This works on a Debian Wheezy box (with Curl and PHP CLI installed), as a regular user:
$ cd
$ mkdir bin; cd bin
$ curl -sS https://getcomposer.org/installer | php
$ alias composer='php ~/bin/composer.phar'
The last line above will allow you to execute composer like this:
$ composer install
To make it permanent, add this line to your .bash_aliases file.
On a Debian Squeeze box with Suhosin installed, you will probably need to add 'phar' to the whitelist:
$ alias composer='php -d suhosin.executor.include.whitelist=phar ~/bin/composer.phar'
Project information
- Module categories: Developer Tools
- Created by jfhovinne on , updated