aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-07-18 16:05:57 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-07-18 16:05:57 +0000
commit0c997a2fe195542c1cdec5b828cea87d0992dc78 (patch)
tree3cdc5bdee6b58c648c479ab2117b619a689c90e7 /engine/lib
parentfefa3a1bdc56cd0e015fee96a9c39b9b60e1d84a (diff)
downloadelgg-0c997a2fe195542c1cdec5b828cea87d0992dc78.tar.gz
elgg-0c997a2fe195542c1cdec5b828cea87d0992dc78.tar.bz2
Standardised plugin loading
git-svn-id: https://code.elgg.org/elgg/trunk@1472 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/plugins.php23
1 files 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/");
- }
- }
- }
- }
+ }
+ }
+
}
}