DolRequestDataCollector.php 1.1 KB

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