From 6d77237f0683a7ca4b5165890e9d009bf6fb2f80 Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Mon, 14 Jan 2013 20:31:32 -0700 Subject: [PATCH 1/2] check plugins in separate function --- boot.php | 18 +++++++++++++----- index.php | 5 ++++- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/boot.php b/boot.php index 1a93086ae..4567d76fc 100644 --- a/boot.php +++ b/boot.php @@ -806,16 +806,12 @@ function is_ajax() { // Primarily involved with database upgrade, but also sets the // base url for use in cmdline programs which don't have -// $_SERVER variables, and synchronising the state of installed plugins. +// $_SERVER variables if(! function_exists('check_config')) { function check_config(&$a) { - $build = get_config('system','build'); - if(! x($build)) - $build = set_config('system','build',DB_UPDATE_VERSION); - $url = get_config('system','url'); // if the url isn't set or the stored url is radically different @@ -830,6 +826,10 @@ if(! function_exists('check_config')) { $url = set_config('system','url',$a->get_baseurl()); + $build = get_config('system','build'); + if(! x($build)) + $build = set_config('system','build',DB_UPDATE_VERSION); + if($build != DB_UPDATE_VERSION) { $stored = intval($build); $current = intval(DB_UPDATE_VERSION); @@ -898,6 +898,14 @@ if(! function_exists('check_config')) { } } + return; + } +} + + +if(! function_exists('check_plugins')) { + function check_plugins(&$a) { + /** * * Synchronise plugins: diff --git a/index.php b/index.php index 4c98cd6e0..c189c51df 100644 --- a/index.php +++ b/index.php @@ -140,8 +140,11 @@ if($install) $a->module = 'install'; elseif($maintenance) $a->module = 'maintenance'; -else +else { proc_run('php', 'include/dbupdate.php'); + check_plugins($a); + //check_config($a); +} nav_set_selected('nothing'); From c32f754b6e1c512b764e1c84356e654b57c6db55 Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Mon, 14 Jan 2013 20:34:28 -0700 Subject: [PATCH 2/2] remove commented-out check_config() --- index.php | 1 - 1 file changed, 1 deletion(-) diff --git a/index.php b/index.php index c189c51df..0ea09c0c7 100644 --- a/index.php +++ b/index.php @@ -143,7 +143,6 @@ elseif($maintenance) else { proc_run('php', 'include/dbupdate.php'); check_plugins($a); - //check_config($a); } nav_set_selected('nothing');