-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
src/Concrete5Debugbar/DataCollector/EnvironmentDataCollector.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
namespace Concrete5Debugbar\DataCollector; | ||
|
||
use DebugBar\DataCollector\DataCollector; | ||
use DebugBar\DataCollector\Renderable; | ||
|
||
class EnvironmentDataCollector extends DataCollector implements Renderable | ||
{ | ||
public function collect() | ||
{ | ||
$data['variables'] = $this->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" => "{}", | ||
], | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters