summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-02-28 20:32:31 -0800
committerEvan Prodromou <evan@controlyourself.ca>2009-02-28 20:32:31 -0800
commitb70218dc437c5decc8b27a2bb70e2e1b6ec6e9e3 (patch)
tree2a5d87cb2f16e7848527a00c66f2bcebf714cfd1 /lib
parentc77bb62f2d0a958e074ad0d9b1334d533cb33121 (diff)
automatically handle non-laconica-named databases
Diffstat (limited to 'lib')
-rw-r--r--lib/common.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/common.php b/lib/common.php
index 2298c5f88..0fff3af2e 100644
--- a/lib/common.php
+++ b/lib/common.php
@@ -187,6 +187,16 @@ foreach ($_config_files as $_config_file) {
}
}
+// XXX: Throw a conniption if database not installed
+
+// Fixup for laconica.ini
+
+$_db_name = substr($config['db']['database'], strrpos($config['db']['database'], '/') + 1);
+
+if ($_db_name != 'laconica' && !array_key_exists('ini_'.$_db_name, $config['db'])) {
+ $config['db']['ini_'.$_db_name] = INSTALLDIR.'/classes/laconica.ini';
+}
+
// XXX: how many of these could be auto-loaded on use?
require_once('Validate.php');