summaryrefslogtreecommitdiff
path: root/lib/common.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-01-07 16:13:36 -0800
committerEvan Prodromou <evan@status.net>2010-01-07 16:13:36 -0800
commit2c33e61b94fca8654c0d543fb0baa164ee86d2c3 (patch)
treed6935d5965b6412de3f6b23814c6617d80c14c79 /lib/common.php
parent6ae6fb7a35cb666fbb59218fa57717522af96f60 (diff)
add default plugins and load them
Diffstat (limited to 'lib/common.php')
-rw-r--r--lib/common.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/common.php b/lib/common.php
index b0e5c4390..fb5e5919e 100644
--- a/lib/common.php
+++ b/lib/common.php
@@ -238,6 +238,27 @@ function __autoload($cls)
}
}
+// Load default plugins
+
+foreach ($config['plugins']['default'] as $name => $params) {
+ if (is_null($params)) {
+ addPlugin($name);
+ } else if (is_array($params)) {
+ if (count($params) == 0) {
+ addPlugin($name);
+ } else {
+ $keys = array_keys($params);
+ if (is_string($keys[0])) {
+ addPlugin($name, $params);
+ } else {
+ foreach ($params as $paramset) {
+ addPlugin($name, $paramset);
+ }
+ }
+ }
+ }
+}
+
// XXX: how many of these could be auto-loaded on use?
// XXX: note that these files should not use config options
// at compile time since DB config options are not yet loaded.