1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-21 05:21:29 +00:00

rework initial sanitycheck to use JSON

This commit is contained in:
Andrew Dolgov
2011-03-18 17:39:23 +03:00
parent 81f6deea47
commit ebb948c24e
7 changed files with 22 additions and 127 deletions

View File

@@ -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
*