3 final class DarkConsoleRequestPlugin
extends DarkConsolePlugin
{
5 public function getName() {
9 public function getDescription() {
11 'Information about %s and %s.',
16 public function generateData() {
17 $addr = idx($_SERVER, 'SERVER_ADDR');
19 $hostname = @gethostbyaddr
($addr);
24 $controller = $this->getRequest()->getController();
26 $controller_class = get_class($controller);
28 $controller_class = null;
31 $site = $this->getRequest()->getSite();
33 $site_class = get_class($site);
39 'request' => $_REQUEST,
42 'site' => $site_class,
43 'controller' => $controller_class,
44 'machine' => php_uname('n'),
46 'hostname' => $hostname,
51 public function renderPanel() {
52 $data = $this->getData();
55 'site' => pht('Site'),
56 'controller' => pht('Controller'),
57 'machine' => pht('Machine'),
58 'host' => pht('Host'),
59 'hostname' => pht('Hostname'),
62 $special = idx($data, 'special', array());
65 foreach ($special_map as $key => $label) {
74 'name' => pht('Basics'),
79 'HTTP_COOKIE' => true,
80 'HTTP_X_PHABRICATOR_CSRF' => true,
85 'name' => pht('Request'),
86 'data' => idx($data, 'request', array()),
89 'name' => pht('Server'),
90 'data' => idx($data, 'server', array()),
94 foreach ($maps as $map) {
97 foreach ($data as $key => $value) {
98 if (isset($mask[$key])) {
99 $value = phutil_tag('em', array(), pht('(Masked)'));
100 } else if (is_array($value)) {
101 $value = @json_encode
($value);
113 'name' => $map['name'],
119 foreach ($sections as $section) {
120 $out[] = id(new AphrontTableView($section['rows']))