2019-03-16 16:27:14 +01:00
|
|
|
<?php
|
2023-01-14 15:57:12 +01: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 16:27:14 +01:00
|
|
|
|
|
|
|
|
dol_include_once('/debugbar/class/autoloader.php');
|
|
|
|
|
|
|
|
|
|
use \DebugBar\DebugBar;
|
|
|
|
|
use \DebugBar\DataCollector\PhpInfoCollector;
|
2021-02-25 22:09:10 +01:00
|
|
|
|
2019-03-16 16:27:14 +01: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 11:30:41 +02:00
|
|
|
dol_include_once('/debugbar/class/DataCollector/DolPhpCollector.php');
|
2019-03-16 16:27:14 +01: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 14:37:54 +01:00
|
|
|
//$this->addCollector(new DolMessagesCollector());
|
2019-03-16 16:27:14 +01:00
|
|
|
$this->addCollector(new DolRequestDataCollector());
|
2019-05-18 01:38:42 +02:00
|
|
|
//$this->addCollector(new DolConfigCollector()); // Disabled for security purpose
|
2019-03-16 16:27:14 +01:00
|
|
|
$this->addCollector(new DolTimeDataCollector());
|
2022-09-18 11:30:41 +02:00
|
|
|
$this->addCollector(new PhpCollector());
|
2019-03-16 16:27:14 +01:00
|
|
|
$this->addCollector(new DolMemoryCollector());
|
2019-03-23 14:37:54 +01:00
|
|
|
//$this->addCollector(new DolExceptionsCollector());
|
2019-03-16 16:27:14 +01:00
|
|
|
$this->addCollector(new DolQueryCollector());
|
|
|
|
|
$this->addCollector(new DolibarrCollector());
|
2022-06-12 21:34:47 +02:00
|
|
|
if (isModEnabled('syslog')) {
|
2019-03-16 16:27:14 +01:00
|
|
|
$this->addCollector(new DolLogsCollector());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns a JavascriptRenderer for this instance
|
|
|
|
|
*
|
2023-02-20 02:37:11 +01:00
|
|
|
* @return DebugBar\JavascriptRenderer String content
|
2019-03-16 16:27:14 +01:00
|
|
|
*/
|
|
|
|
|
public function getRenderer()
|
|
|
|
|
{
|
2020-09-08 21:27:28 +02:00
|
|
|
$renderer = parent::getJavascriptRenderer(DOL_URL_ROOT.'/includes/maximebf/debugbar/src/DebugBar/Resources');
|
2022-12-24 15:06:32 +01: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 15:32:20 +01:00
|
|
|
$renderer->setEnableJqueryNoConflict(false); // We don't need no conflict
|
2020-09-08 21:27:28 +02:00
|
|
|
return $renderer;
|
2019-03-16 16:27:14 +01:00
|
|
|
}
|
2019-03-16 20:10:22 +01:00
|
|
|
}
|