diff --git a/EVENTS.txt b/EVENTS.txt index 68e25fa3b0..4b8260b3ce 100644 --- a/EVENTS.txt +++ b/EVENTS.txt @@ -1,3 +1,8 @@ +InitializePlugin: a chance to initialize a plugin in a complete + environment + +CleanupPlugin: a chance to cleanup a plugin at the end of a program + StartPrimaryNav: Showing the primary nav menu - $action: the current action diff --git a/index.php b/index.php index dac5a8071a..0a79b9731d 100644 --- a/index.php +++ b/index.php @@ -85,3 +85,8 @@ if (!file_exists($actionfile)) { $sac->showPage(); } } + +// XXX: cleanup exit() calls or add an exit handler so +// this always gets called + +Event::handle('CleanupPlugin'); diff --git a/lib/common.php b/lib/common.php index 64c7f2410a..2f85eb7c51 100644 --- a/lib/common.php +++ b/lib/common.php @@ -212,3 +212,7 @@ function __autoload($class) require_once(INSTALLDIR.'/lib/' . strtolower($class) . '.php'); } } + +// Give plugins a chance to initialize in a fully-prepared environment + +Event::handle('InitializePlugin');