DolibarrLabs / dolibarr-debugbar-module

Debug Bar module for Dolibarr ERP/CRM

Home Page:https://www.dolistore.com/en/modules/996-Debug-bar.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dolibarr Debug Bar

A Debug Bar module for Dolibarr ERP/CRM based on phpdebugbar.

Screenshot

Installation

  • Download the module zip file from Dolistore.
  • Install the module from Home > Setup > Modules > Deploy/install external app/module & then upload the zip file or just unzip it by yourself into the root directory of Dolibarr or in custom directory.
  • Activate the module.

Quick start

Once the module activated, a global variable $debugbar will be added automatically to your php scripts each time you include Dolibarr's main.inc.php file.

Here is a basic usage example of the DebugBar:

<?php

// Require Dolibarr main file
require '../main.inc.php';

// Tell PHP that we want to use the debugbar variable defined in main.inc.php
global $debugbar;

// Add a message to debugbar
$debugbar['messages']->addMessage('hello world!');

?>

To save/stack data on page redirect:

<?php

// Require Dolibarr main file
require '../main.inc.php';

global $debugbar;

// Do something
// ...

// Stack debugbar data (just before redirecting)
$debugbar->stackData();

// Redirect
header('Location: page.php');

?>

Note: You can even create your own redirect function to avoid rewriting the same lines of code every time.

Learn more about DebugBar in the docs.

About

Debug Bar module for Dolibarr ERP/CRM

https://www.dolistore.com/en/modules/996-Debug-bar.html

License:MIT License


Languages

Language:PHP 77.7%Language:JavaScript 16.1%Language:CSS 6.2%