From ebb948c24e667f651fe882100cc478f0534b8760 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 18 Mar 2011 17:39:23 +0300 Subject: rework initial sanitycheck to use JSON --- functions.php | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) (limited to 'functions.php') diff --git a/functions.php b/functions.php index b0c768ff8..1e9e5a576 100644 --- a/functions.php +++ b/functions.php @@ -2227,6 +2227,8 @@ function sanity_check($link) { + global $ERRORS; + $error_code = 0; $schema_version = get_schema_version($link); @@ -2245,12 +2247,7 @@ $error_code = 12; } - if ($error_code != 0) { - print_error_xml($error_code); - return false; - } else { - return true; - } + return array("code" => $error_code, "message" => $ERRORS[$error_code]); } function file_is_locked($filename) { @@ -2851,20 +2848,6 @@ return $version[1]; } - function print_error_xml($code, $add_msg = "") { - global $ERRORS; - - $error_msg = $ERRORS[$code]; - - if ($add_msg) { - $error_msg = "$error_msg; $add_msg"; - } - - print ""; - print ""; - print ""; - } - /** * Subscribes the user to the given feed * -- cgit v1.2.3