summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-01-28 16:35:38 -0500
committerEvan Prodromou <evan@status.net>2010-01-28 16:35:38 -0500
commitfa7895333724e314e2b32cb89f19a41069c554be (patch)
treebd7598662197b7b0aa5b4e40a889010b88ddcf9b /index.php
parent513f8be07a22d722b86509e570bee46d028066f2 (diff)
move RW setup above user get in index.php so remember_me works
Diffstat (limited to 'index.php')
-rw-r--r--index.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/index.php b/index.php
index 5520d690b..5aa40440a 100644
--- a/index.php
+++ b/index.php
@@ -146,7 +146,7 @@ function formatBacktraceLine($n, $line)
return $out;
}
-function checkMirror($action_obj, $args)
+function setupRW()
{
global $config;
@@ -161,7 +161,10 @@ function checkMirror($action_obj, $args)
foreach ($alwaysRW as $table) {
$config['db']['table_'.$table] = 'rw';
}
+}
+function checkMirror($action_obj, $args)
+{
if (common_config('db', 'mirror') && $action_obj->isReadOnly($args)) {
if (is_array(common_config('db', 'mirror'))) {
// "load balancing", ha ha
@@ -237,9 +240,13 @@ function main()
PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'handleError');
+ // Make sure RW database is setup
+
+ setupRW();
+
// XXX: we need a little more structure in this script
- // get and cache current user
+ // get and cache current user (may hit RW!)
$user = common_current_user();