dolibarr/htdocs/debugbar/class/DataCollector/DolRequestDataCollector.php

62 lines
1.1 KiB
PHP
Raw Normal View History

2019-03-16 15:27:14 +00:00
<?php
use \DebugBar\DataCollector\RequestDataCollector;
/**
* DolRequestDataCollector class
*/
class DolRequestDataCollector extends RequestDataCollector
{
2019-07-02 21:14:22 +00:00
/**
* Collects the data from the collectors
*
* @return array
*/
2019-07-02 12:38:26 +00:00
public function collect()
{
$vars = array('_GET', '_POST', '_SESSION', '_COOKIE', '_SERVER');
$data = array();
foreach ($vars as $var) {
if (isset($GLOBALS[$var])) {
$arrayofvalues = $GLOBALS[$var];
if ($var == '_COOKIE') {
foreach ($arrayofvalues as $key => $val) {
if (preg_match('/^DOLSESSID_/', $key)) {
$arrayofvalues[$key] = '*****hidden*****';
}
2019-07-02 12:38:26 +00:00
}
//var_dump($arrayofvalues);
}
$data["$".$var] = $this->getDataFormatter()->formatVar($arrayofvalues);
2019-07-02 12:38:26 +00:00
}
}
return $data;
}
2019-03-16 15:27:14 +00:00
/**
* Return widget settings
*
2019-03-16 18:37:54 +00:00
* @return void
2019-03-16 15:27:14 +00:00
*/
public function getWidgets()
{
global $langs;
$langs->load("other");
2019-03-16 15:27:14 +00:00
return array(
2019-07-02 12:38:26 +00:00
$langs->transnoentities('Variables') => array(
2019-03-16 15:27:14 +00:00
"icon" => "tags",
"widget" => "PhpDebugBar.Widgets.VariableListWidget",
"map" => "request",
"default" => "{}"
)
);
}
2019-03-16 18:37:54 +00:00
}