2019-03-16 15:27:14 +00:00
|
|
|
<?php
|
2023-01-14 14:57:12 +00:00
|
|
|
/* Copyright (C) 2023 Laurent Destailleur <eldy@users.sourceforge.net>
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \file htdocs/debugbar/class/DebugBar.php
|
|
|
|
|
* \brief Class for debugbar
|
|
|
|
|
* \ingroup debugbar
|
|
|
|
|
*/
|
2019-03-16 15:27:14 +00:00
|
|
|
|
|
|
|
|
dol_include_once('/debugbar/class/autoloader.php');
|
|
|
|
|
|
2023-04-30 01:10:20 +00:00
|
|
|
use DebugBar\DebugBar;
|
2021-02-25 21:09:10 +00:00
|
|
|
|
2019-03-16 15:27:14 +00:00
|
|
|
dol_include_once('/debugbar/class/DataCollector/DolMessagesCollector.php');
|
|
|
|
|
dol_include_once('/debugbar/class/DataCollector/DolRequestDataCollector.php');
|
|
|
|
|
dol_include_once('/debugbar/class/DataCollector/DolConfigCollector.php');
|
|
|
|
|
dol_include_once('/debugbar/class/DataCollector/DolTimeDataCollector.php');
|
|
|
|
|
dol_include_once('/debugbar/class/DataCollector/DolMemoryCollector.php');
|
2022-09-18 09:30:41 +00:00
|
|
|
dol_include_once('/debugbar/class/DataCollector/DolPhpCollector.php');
|
2019-03-16 15:27:14 +00:00
|
|
|
dol_include_once('/debugbar/class/DataCollector/DolExceptionsCollector.php');
|
|
|
|
|
dol_include_once('/debugbar/class/DataCollector/DolQueryCollector.php');
|
|
|
|
|
dol_include_once('/debugbar/class/DataCollector/DolibarrCollector.php');
|
|
|
|
|
dol_include_once('/debugbar/class/DataCollector/DolLogsCollector.php');
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* DolibarrDebugBar class
|
|
|
|
|
*
|
|
|
|
|
* @see http://phpdebugbar.com/docs/base-collectors.html#base-collectors
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
class DolibarrDebugBar extends DebugBar
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Constructor
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
public function __construct()
|
|
|
|
|
{
|
|
|
|
|
global $conf;
|
|
|
|
|
|
|
|
|
|
//$this->addCollector(new PhpInfoCollector());
|
2019-03-23 13:37:54 +00:00
|
|
|
//$this->addCollector(new DolMessagesCollector());
|
2019-03-16 15:27:14 +00:00
|
|
|
$this->addCollector(new DolRequestDataCollector());
|
2019-05-17 23:38:42 +00:00
|
|
|
//$this->addCollector(new DolConfigCollector()); // Disabled for security purpose
|
2019-03-16 15:27:14 +00:00
|
|
|
$this->addCollector(new DolTimeDataCollector());
|
2022-09-18 09:30:41 +00:00
|
|
|
$this->addCollector(new PhpCollector());
|
2019-03-16 15:27:14 +00:00
|
|
|
$this->addCollector(new DolMemoryCollector());
|
2019-03-23 13:37:54 +00:00
|
|
|
//$this->addCollector(new DolExceptionsCollector());
|
2019-03-16 15:27:14 +00:00
|
|
|
$this->addCollector(new DolQueryCollector());
|
|
|
|
|
$this->addCollector(new DolibarrCollector());
|
2022-06-12 19:34:47 +00:00
|
|
|
if (isModEnabled('syslog')) {
|
2019-03-16 15:27:14 +00:00
|
|
|
$this->addCollector(new DolLogsCollector());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns a JavascriptRenderer for this instance
|
|
|
|
|
*
|
2023-03-19 09:19:35 +00:00
|
|
|
* @return \DebugBar\JavascriptRenderer String content
|
2019-03-16 15:27:14 +00:00
|
|
|
*/
|
|
|
|
|
public function getRenderer()
|
|
|
|
|
{
|
2020-09-08 19:27:28 +00:00
|
|
|
$renderer = parent::getJavascriptRenderer(DOL_URL_ROOT.'/includes/maximebf/debugbar/src/DebugBar/Resources');
|
2022-12-24 14:06:32 +00:00
|
|
|
$renderer->disableVendor('jquery'); // We already have jquery loaded globally by the main.inc.php
|
|
|
|
|
$renderer->disableVendor('fontawesome'); // We already have fontawesome loaded globally by the main.inc.php
|
|
|
|
|
$renderer->disableVendor('highlightjs'); // We don't need this
|
2022-12-24 14:32:20 +00:00
|
|
|
$renderer->setEnableJqueryNoConflict(false); // We don't need no conflict
|
2023-03-19 09:19:35 +00:00
|
|
|
|
2020-09-08 19:27:28 +00:00
|
|
|
return $renderer;
|
2019-03-16 15:27:14 +00:00
|
|
|
}
|
2019-03-16 19:10:22 +00:00
|
|
|
}
|