dolibarr  17.0.3
DebugBar.php
1 <?php
2 
3 dol_include_once('/debugbar/class/autoloader.php');
4 
5 use \DebugBar\DebugBar;
6 use \DebugBar\DataCollector\PhpInfoCollector;
7 
8 dol_include_once('/debugbar/class/DataCollector/DolMessagesCollector.php');
9 dol_include_once('/debugbar/class/DataCollector/DolRequestDataCollector.php');
10 dol_include_once('/debugbar/class/DataCollector/DolConfigCollector.php');
11 dol_include_once('/debugbar/class/DataCollector/DolTimeDataCollector.php');
12 dol_include_once('/debugbar/class/DataCollector/DolMemoryCollector.php');
13 dol_include_once('/debugbar/class/DataCollector/DolPhpCollector.php');
14 dol_include_once('/debugbar/class/DataCollector/DolExceptionsCollector.php');
15 dol_include_once('/debugbar/class/DataCollector/DolQueryCollector.php');
16 dol_include_once('/debugbar/class/DataCollector/DolibarrCollector.php');
17 dol_include_once('/debugbar/class/DataCollector/DolLogsCollector.php');
18 
25 class DolibarrDebugBar extends DebugBar
26 {
31  public function __construct()
32  {
33  global $conf;
34 
35  //$this->addCollector(new PhpInfoCollector());
36  //$this->addCollector(new DolMessagesCollector());
37  $this->addCollector(new DolRequestDataCollector());
38  //$this->addCollector(new DolConfigCollector()); // Disabled for security purpose
39  $this->addCollector(new DolTimeDataCollector());
40  $this->addCollector(new PhpCollector());
41  $this->addCollector(new DolMemoryCollector());
42  //$this->addCollector(new DolExceptionsCollector());
43  $this->addCollector(new DolQueryCollector());
44  $this->addCollector(new DolibarrCollector());
45  if (isModEnabled('syslog')) {
46  $this->addCollector(new DolLogsCollector());
47  }
48  }
49 
55  public function getRenderer()
56  {
57  $renderer = parent::getJavascriptRenderer(DOL_URL_ROOT.'/includes/maximebf/debugbar/src/DebugBar/Resources');
58  $renderer->disableVendor('jquery'); // We already have jquery loaded globally by the main.inc.php
59  $renderer->disableVendor('fontawesome'); // We already have fontawesome loaded globally by the main.inc.php
60  $renderer->disableVendor('highlightjs'); // We don't need this
61  $renderer->setEnableJqueryNoConflict(false); // We don't need no conflict
62  return $renderer;
63  }
64 }
DolTimeDataCollector
DolTimeDataCollector class.
Definition: DolTimeDataCollector.php:8
dol_include_once
if(!function_exists('dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
Definition: functions.lib.php:1032
DolibarrCollector
DolibarrCollector class.
Definition: DolibarrCollector.php:12
DolibarrDebugBar\__construct
__construct()
Constructor.
Definition: DebugBar.php:31
DolQueryCollector
DolQueryCollector class.
Definition: DolQueryCollector.php:13
DolibarrDebugBar\getRenderer
getRenderer()
Returns a JavascriptRenderer for this instance.
Definition: DebugBar.php:55
DolMemoryCollector
DolMemoryCollector class.
Definition: DolMemoryCollector.php:9
isModEnabled
isModEnabled($module)
Is Dolibarr module enabled.
Definition: functions.lib.php:137
PhpCollector
Class PhpCollector.
Definition: DolPhpCollector.php:12
DolibarrDebugBar
DolibarrDebugBar class.
Definition: DebugBar.php:25
DolLogsCollector
DolLogsCollector class.
Definition: DolLogsCollector.php:12
DolRequestDataCollector
DolRequestDataCollector class.
Definition: DolRequestDataCollector.php:9