From 23a34583a812bbbe5df0bcdc4a40ba32bc4ce409 Mon Sep 17 00:00:00 2001 From: ben Date: Fri, 15 Feb 2008 12:57:00 +0000 Subject: Simple plugin mechanism git-svn-id: https://code.elgg.org/elgg/trunk@39 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/plugins.php | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 engine/lib/plugins.php (limited to 'engine/lib/plugins.php') diff --git a/engine/lib/plugins.php b/engine/lib/plugins.php new file mode 100644 index 000000000..81f5757e9 --- /dev/null +++ b/engine/lib/plugins.php @@ -0,0 +1,46 @@ +pluginspath)) { + + if ($handle = opendir($CONFIG->pluginspath)) { + while ($mod = readdir($handle)) { + if (!in_array($mod,array('.','..','.svn','CVS')) && is_dir($mod)) { + if (!@include($ONFIG->pluginspath . $mod . "/start.php")) + throw new PluginException("{$mod} is a misconfigured plugin."); + } + } + } + + } + + } + + /** + * @class PluginException + * A plugin Exception, thrown when an Exception occurs relating to the plugin mechanism. Subclass for specific plugin Exceptions. + */ + + class PluginException extends Exception {} + +?> \ No newline at end of file -- cgit v1.2.3