dolibarr  19.0.0-dev
DebugBar.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2023 Laurent Destailleur <eldy@users.sourceforge.net>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <https://www.gnu.org/licenses/>.
16  */
17 
24 dol_include_once('/debugbar/class/autoloader.php');
25 
26 use DebugBar\DebugBar;
27 
28 dol_include_once('/debugbar/class/DataCollector/DolMessagesCollector.php');
29 dol_include_once('/debugbar/class/DataCollector/DolRequestDataCollector.php');
30 dol_include_once('/debugbar/class/DataCollector/DolConfigCollector.php');
31 dol_include_once('/debugbar/class/DataCollector/DolTimeDataCollector.php');
32 dol_include_once('/debugbar/class/DataCollector/DolMemoryCollector.php');
33 dol_include_once('/debugbar/class/DataCollector/DolPhpCollector.php');
34 dol_include_once('/debugbar/class/DataCollector/DolExceptionsCollector.php');
35 dol_include_once('/debugbar/class/DataCollector/DolQueryCollector.php');
36 dol_include_once('/debugbar/class/DataCollector/DolibarrCollector.php');
37 dol_include_once('/debugbar/class/DataCollector/DolLogsCollector.php');
38 
45 class DolibarrDebugBar extends DebugBar
46 {
51  public function __construct()
52  {
53  global $conf;
54 
55  //$this->addCollector(new PhpInfoCollector());
56  //$this->addCollector(new DolMessagesCollector());
57  $this->addCollector(new DolRequestDataCollector());
58  //$this->addCollector(new DolConfigCollector()); // Disabled for security purpose
59  $this->addCollector(new DolTimeDataCollector());
60  $this->addCollector(new PhpCollector());
61  $this->addCollector(new DolMemoryCollector());
62  //$this->addCollector(new DolExceptionsCollector());
63  $this->addCollector(new DolQueryCollector());
64  $this->addCollector(new DolibarrCollector());
65  if (isModEnabled('syslog')) {
66  $this->addCollector(new DolLogsCollector());
67  }
68  }
69 
75  public function getRenderer()
76  {
77  $renderer = parent::getJavascriptRenderer(DOL_URL_ROOT.'/includes/maximebf/debugbar/src/DebugBar/Resources');
78  $renderer->disableVendor('jquery'); // We already have jquery loaded globally by the main.inc.php
79  $renderer->disableVendor('fontawesome'); // We already have fontawesome loaded globally by the main.inc.php
80  $renderer->disableVendor('highlightjs'); // We don't need this
81  $renderer->setEnableJqueryNoConflict(false); // We don't need no conflict
82 
83  return $renderer;
84  }
85 }
DolLogsCollector class.
DolMemoryCollector class.
DolQueryCollector class.
DolRequestDataCollector class.
DolTimeDataCollector class.
DolibarrCollector class.
DolibarrDebugBar class.
Definition: DebugBar.php:46
getRenderer()
Returns a JavascriptRenderer for this instance.
Definition: DebugBar.php:75
__construct()
Constructor.
Definition: DebugBar.php:51
Class PhpCollector.
if(!function_exists('dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
isModEnabled($module)
Is Dolibarr module enabled.