1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-28 00:10:57 +01:00
phorge-phorge/src/infrastructure/events/PhabricatorEventEngine.php

37 lines
1 KiB
PHP
Raw Normal View History

<?php
/**
* @group events
*/
final class PhabricatorEventEngine {
public static function initialize() {
$listeners = PhabricatorEnv::getEnvConfig('events.listeners');
foreach ($listeners as $listener) {
try {
id(new $listener())->register();
} catch (Exception $ex) {
// If the listener does not exist, or throws when registering, just
// log it and continue. In particular, this is important to let you
// run `bin/config` in order to remove an invalid listener.
phlog($ex);
}
}
// Register the DarkConosole event logger.
id(new DarkConsoleEventPluginAPI())->register();
id(new ManiphestEdgeEventListener())->register();
$applications = PhabricatorApplication::getAllInstalledApplications();
foreach ($applications as $application) {
$listeners = $application->getEventListeners();
foreach ($listeners as $listener) {
$listener->setApplication($application);
$listener->register();
}
}
}
}