Add InitializePlugin and CleanupPlugin events

We add two events to allow plugins to initialize and cleanup.
This commit is contained in:
Evan Prodromou 2009-02-09 08:44:30 -05:00
parent 5d246299b6
commit f4e8cc6d9f
3 changed files with 14 additions and 0 deletions

View File

@ -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

View File

@ -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');

View File

@ -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');