diff options
author | Andrew Dolgov <[email protected]> | 2011-03-18 17:39:23 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2011-03-18 17:39:23 +0300 |
commit | ebb948c24e667f651fe882100cc478f0534b8760 (patch) | |
tree | ad1817f8625575ba03614863e413bb1acb869a66 /functions.php | |
parent | 81f6deea473257379ef43ceb07077527b9d91dbb (diff) |
rework initial sanitycheck to use JSON
Diffstat (limited to 'functions.php')
-rw-r--r-- | functions.php | 23 |
1 files changed, 3 insertions, 20 deletions
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 "<rpc-reply>"; - print "<error error-code=\"$code\" error-msg=\"$error_msg\"/>"; - print "</rpc-reply>"; - } - /** * Subscribes the user to the given feed * |