From 745cdd206cb5b0c286c9b84bea6ee98ce4868d95 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 11 Mar 2009 23:43:03 -0400 Subject: fixup config errors --- index.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index dae1ae751..e83d08c13 100644 --- a/index.php +++ b/index.php @@ -63,7 +63,7 @@ function handleError($error) function main() { - global $user, $action; + global $user, $action, $config; if (!_have_config()) { $msg = sprintf(_("No configuration file found. Try running ". @@ -131,11 +131,11 @@ function main() if (common_config('db', 'mirror') && $action_obj->isReadOnly()) { if (is_array(common_config('db', 'mirror'))) { // "load balancing", ha ha - $k = array_rand($config['db']['mirror']); - - $mirror = $config['db']['mirror'][$k]; + $arr = common_config('db', 'mirror'); + $k = array_rand($arr); + $mirror = $arr[$k]; } else { - $mirror = $config['db']['mirror']; + $mirror = common_config('db', 'mirror'); } $config['db']['database'] = $mirror; } -- cgit v1.2.3-54-g00ecf