Build an event dispatch mechanism into Phabricator
Summary: This is an attempt to satisfy a lot of the one-off requests a little more generally, by providing a relatively generic piece of event architecture. Allow the registation of event listeners which can react to various application events (currently, task editing). I'll doc this a bit better but I wanted to see if anyone had massive objections to doing this or the broad approach. The specific problem I want to address is that one client wants to do a bunch of routing for tasks via email, so it's either build a hook, or have them override most of ManiphestReplyHandler, or something slightly more general like this. Test Plan: Wrote a silly listener that adds "Quack!" to a task every time it is edited and edited some tasks. I was justly rewarded. Reviewers: nh, jungejason, tuomaspelkonen, aran Reviewed By: aran CC: aran, epriestley Differential Revision: 881
This commit is contained in:
@@ -33,3 +33,4 @@ phutil_load_library(dirname(__FILE__).'/../src/');
|
||||
// NOTE: This is dangerous in general, but we know we're in a script context and
|
||||
// are not vulnerable to CSRF.
|
||||
AphrontWriteGuard::allowDangerousUnguardedWrites(true);
|
||||
PhabricatorEventEngine::initialize();
|
||||
|
||||
Reference in New Issue
Block a user