dolibarr  17.0.4
DolRequestDataCollector.php
1 <?php
2 
3 use \DebugBar\DataCollector\RequestDataCollector;
4 
9 class DolRequestDataCollector extends RequestDataCollector
10 {
16  public function collect()
17  {
18  $vars = array('_GET', '_POST', '_SESSION', '_COOKIE', '_SERVER');
19  $data = array();
20 
21  foreach ($vars as $var) {
22  if (isset($GLOBALS[$var])) {
23  $arrayofvalues = $GLOBALS[$var];
24 
25  if ($var == '_COOKIE') {
26  foreach ($arrayofvalues as $key => $val) {
27  if (preg_match('/^DOLSESSID_/', $key)) {
28  $arrayofvalues[$key] = '*****hidden*****';
29  }
30  }
31  //var_dump($arrayofvalues);
32  }
33 
34  $data["$".$var] = $this->getDataFormatter()->formatVar($arrayofvalues);
35  }
36  }
37 
38  return $data;
39  }
40 
46  public function getWidgets()
47  {
48  global $langs;
49 
50  $langs->load("other");
51 
52  return array(
53  $langs->transnoentities('Variables') => array(
54  "icon" => "tags",
55  "widget" => "PhpDebugBar.Widgets.VariableListWidget",
56  "map" => "request",
57  "default" => "{}"
58  )
59  );
60  }
61 }
DolRequestDataCollector class.
collect()
Collects the data from the collectors.
getWidgets()
Return widget settings.