Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/events/PhabricatorEventEngine.php
<?php | <?php | ||||
final class PhabricatorEventEngine extends Phobject { | final class PhabricatorEventEngine extends Phobject { | ||||
public static function initialize() { | public static function initialize() { | ||||
// NOTE: If any of this fails, we just log it and move on. It's important | // NOTE: If any of this fails, we just log it and move on. It's important | ||||
// to try to make it through here because users may have difficulty fixing | // to try to make it through here because users may have difficulty fixing | ||||
// fix the errors if we don't: for example, if we fatal here a user may not | // fix the errors if we don't: for example, if we fatal here a user may not | ||||
// be able to run `bin/config` in order to remove an invalid listener. | // be able to run `bin/config` in order to remove an invalid listener. | ||||
// Load automatic listeners. | // Load automatic listeners. | ||||
$listeners = id(new PhutilSymbolLoader()) | $listeners = id(new PhutilClassMapQuery()) | ||||
->setAncestorClass('PhabricatorAutoEventListener') | ->setAncestorClass('PhabricatorAutoEventListener') | ||||
->loadObjects(); | ->execute(); | ||||
// Load configured listeners. | // Load configured listeners. | ||||
$config_listeners = PhabricatorEnv::getEnvConfig('events.listeners'); | $config_listeners = PhabricatorEnv::getEnvConfig('events.listeners'); | ||||
foreach ($config_listeners as $listener_class) { | foreach ($config_listeners as $listener_class) { | ||||
try { | try { | ||||
$listeners[] = newv($listener_class, array()); | $listeners[] = newv($listener_class, array()); | ||||
} catch (Exception $ex) { | } catch (Exception $ex) { | ||||
phlog($ex); | phlog($ex); | ||||
Show All 27 Lines |