3 final class DarkConsoleEventPlugin
extends DarkConsolePlugin
{
5 public function getName() {
9 public function getDescription() {
10 return pht('Information about Phabricator events and event listeners.');
13 public function generateData() {
14 $listeners = PhutilEventEngine
::getInstance()->getAllListeners();
15 foreach ($listeners as $key => $listener) {
16 $listeners[$key] = array(
17 'id' => $listener->getListenerID(),
18 'class' => get_class($listener),
22 $events = DarkConsoleEventPluginAPI
::getEvents();
23 foreach ($events as $key => $event) {
24 $events[$key] = array(
25 'type' => $event->getType(),
26 'stopped' => $event->isStopped(),
31 'listeners' => $listeners,
36 public function renderPanel() {
37 $data = $this->getData();
43 array('class' => 'dark-console-panel-header'),
44 phutil_tag('h1', array(), pht('Registered Event Listeners')));
47 foreach ($data['listeners'] as $listener) {
48 $rows[] = array($listener['id'], $listener['class']);
51 $table = new AphrontTableView($rows);
55 pht('Listener Class'),
57 $table->setColumnClasses(
63 $out[] = $table->render();
67 array('class' => 'dark-console-panel-header'),
68 phutil_tag('h1', array(), pht('Event Log')));
71 foreach ($data['events'] as $event) {
74 $event['stopped'] ?
pht('STOPPED') : null,
78 $table = new AphrontTableView($rows);
79 $table->setColumnClasses(
89 $out[] = $table->render();
92 return phutil_implode_html("\n", $out);