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

62 lines
1.1 KiB
PHP
Raw Normal View History

2019-03-16 16:27:14 +01:00
<?php
use \DebugBar\DataCollector\RequestDataCollector;
/**
* DolRequestDataCollector class
*/
class DolRequestDataCollector extends RequestDataCollector
{
2019-07-02 23:14:22 +02:00
/**
* Collects the data from the collectors
*
* @return array
*/
2019-07-02 14:38:26 +02: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 14:38:26 +02:00
}
//var_dump($arrayofvalues);
}
$data["$".$var] = $this->getDataFormatter()->formatVar($arrayofvalues);
2019-07-02 14:38:26 +02:00
}
}
return $data;
}
2019-03-16 16:27:14 +01:00
/**
* Return widget settings
*
2019-03-16 19:37:54 +01:00
* @return void
2019-03-16 16:27:14 +01:00
*/
public function getWidgets()
{
global $langs;
$langs->load("other");
2019-03-16 16:27:14 +01:00
return array(
2019-07-02 14:38:26 +02:00
$langs->transnoentities('Variables') => array(
2019-03-16 16:27:14 +01:00
"icon" => "tags",
"widget" => "PhpDebugBar.Widgets.VariableListWidget",
"map" => "request",
"default" => "{}"
)
);
}
2019-03-16 19:37:54 +01:00
}