1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-22 08:41: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

@@ -307,23 +307,21 @@
return;
}
// XML method
if ($subop == "sanityCheck") {
header("Content-Type: text/plain");
$_SESSION["hasAudio"] = $_REQUEST["hasAudio"] === "true";
print "<rpc-reply>";
if (sanity_check($link)) {
print "<error error-code=\"0\"/>";
$reply = array();
print "<init-params><![CDATA[";
print json_encode(make_init_params($link));
print "]]></init-params>";
$reply['error'] = sanity_check($link);
print_runtime_info($link);
if ($reply['error']['code'] == 0) {
$reply['init-params'] = make_init_params($link);
$reply['runtime-info'] = make_runtime_info($link);
}
print "</rpc-reply>";
print json_encode($reply);
return;
}