From 0c997a2fe195542c1cdec5b828cea87d0992dc78 Mon Sep 17 00:00:00 2001 From: ben Date: Fri, 18 Jul 2008 16:05:57 +0000 Subject: Standardised plugin loading git-svn-id: https://code.elgg.org/elgg/trunk@1472 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/plugins.php | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/engine/lib/plugins.php b/engine/lib/plugins.php index 51a47601d..b22dec7be 100644 --- a/engine/lib/plugins.php +++ b/engine/lib/plugins.php @@ -55,11 +55,23 @@ global $CONFIG; if (!empty($CONFIG->pluginspath)) { + $plugins = array(); + if ($handle = opendir($CONFIG->pluginspath)) { while ($mod = readdir($handle)) { if (!in_array($mod,array('.','..','.svn','CVS')) && is_dir($CONFIG->pluginspath . "/" . $mod)) { - if (is_plugin_enabled($mod)) - { + if (is_plugin_enabled($mod)) { + + $plugins[] = $mod; + + } + } + } + + sort($plugins); + + if (sizeof($plugins)) + foreach($plugins as $mod) { if (!@include($CONFIG->pluginspath . $mod . "/start.php")) throw new PluginException(sprintf(elgg_echo('PluginException:MisconfiguredPlugin'), $mod)); if (is_dir($CONFIG->pluginspath . $mod . "/views/default")) { @@ -67,10 +79,9 @@ } if (is_dir($CONFIG->pluginspath . $mod . "/languages")) { register_translations($CONFIG->pluginspath . $mod . "/languages/"); - } - } - } - } + } + } + } } -- cgit v1.2.3