diff --git a/src/Concrete5Debugbar/DataCollector/EnvironmentDataCollector.php b/src/Concrete5Debugbar/DataCollector/EnvironmentDataCollector.php new file mode 100644 index 0000000..0838107 --- /dev/null +++ b/src/Concrete5Debugbar/DataCollector/EnvironmentDataCollector.php @@ -0,0 +1,36 @@ +getDataFormatter()->formatVar(get_defined_vars()); + $data['server'] = $this->getDataFormatter()->formatVar($_SERVER); + $data['classes'] = $this->getDataFormatter()->formatVar(get_declared_classes()); + $data['functions'] = $this->getDataFormatter()->formatVar(get_defined_functions()); + $data['constants'] = $this->getDataFormatter()->formatVar(get_defined_constants()); + + return $data; + } + + public function getName() + { + return 'environment'; + } + + public function getWidgets() + { + return [ + "environment" => [ + "icon" => "file-archive-o", + "widget" => "PhpDebugBar.Widgets.VariableListWidget", + "map" => "environment", + "default" => "{}", + ], + ]; + } +} diff --git a/src/Concrete5Debugbar/Debugbar.php b/src/Concrete5Debugbar/Debugbar.php index 4922bd1..2fb36b6 100644 --- a/src/Concrete5Debugbar/Debugbar.php +++ b/src/Concrete5Debugbar/Debugbar.php @@ -1,6 +1,7 @@ getConfiguration()->setSQLLogger($doctrineDebugStack); $this->addCollector(new DoctrineCollector($doctrineDebugStack)); $this->addCollector(new LogDataCollector()); + $this->addCollector(new EnvironmentDataCollector()); // TODO: AuthenticationCollector: Show currently login user, session, etc. // TODO: ControllerCollector: Show info of the controller of current request // TODO: EventsCollector: Show all events on current request