Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/console/plugin/event/DarkConsoleEventPluginAPI.php
13409 views
1
<?php
2
3
final class DarkConsoleEventPluginAPI extends PhabricatorEventListener {
4
5
private static $events = array();
6
private static $discardMode = false;
7
8
public static function enableDiscardMode() {
9
self::$discardMode = true;
10
}
11
12
public static function getEvents() {
13
return self::$events;
14
}
15
16
public function register() {
17
$this->listen(PhabricatorEventType::TYPE_ALL);
18
}
19
20
public function handleEvent(PhutilEvent $event) {
21
if (self::$discardMode) {
22
return;
23
}
24
self::$events[] = $event;
25
}
26
27
}
28
29