summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--EVENTS.txt5
-rw-r--r--index.php5
-rw-r--r--lib/common.php4
3 files changed, 14 insertions, 0 deletions
diff --git a/EVENTS.txt b/EVENTS.txt
index 68e25fa3b..4b8260b3c 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 dac5a8071..0a79b9731 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 64c7f2410..2f85eb7c5 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');