summaryrefslogtreecommitdiff
path: root/lib/common.php
diff options
context:
space:
mode:
authorroot <root@ip-10-250-162-129.ec2.internal>2010-01-09 23:25:08 +0000
committerroot <root@ip-10-250-162-129.ec2.internal>2010-01-09 23:25:08 +0000
commitd59df6b27013fb534d6444d8e4790f2edcd9459a (patch)
treebd5bcc8e4ecd0e9391efdcac8ff906fd8b506a60 /lib/common.php
parentd6db8e58170e6e78a0fd67d50f7fea5d95b5d9c8 (diff)
parentf396701b6466749c09ce16b1e7f2f96c10b05cdd (diff)
Merge branch '0.9.x' of git://gitorious.org/statusnet/mainline into 0.9.x
Diffstat (limited to 'lib/common.php')
-rw-r--r--lib/common.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/common.php b/lib/common.php
index 7fa1910af..fb5e5919e 100644
--- a/lib/common.php
+++ b/lib/common.php
@@ -210,6 +210,18 @@ if ($_db_name != 'statusnet' && !array_key_exists('ini_'.$_db_name, $config['db'
$config['db']['ini_'.$_db_name] = INSTALLDIR.'/classes/statusnet.ini';
}
+// Backwards compatibility
+
+if (array_key_exists('memcached', $config)) {
+ if ($config['memcached']['enabled']) {
+ addPlugin('Memcache', array('servers' => $config['memcached']['server']));
+ }
+
+ if (!empty($config['memcached']['base'])) {
+ $config['cache']['base'] = $config['memcached']['base'];
+ }
+}
+
function __autoload($cls)
{
if (file_exists(INSTALLDIR.'/classes/' . $cls . '.php')) {
@@ -226,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.