summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2011-03-18 17:39:23 +0300
committerAndrew Dolgov <[email protected]>2011-03-18 17:39:23 +0300
commitebb948c24e667f651fe882100cc478f0534b8760 (patch)
treead1817f8625575ba03614863e413bb1acb869a66 /modules
parent81f6deea473257379ef43ceb07077527b9d91dbb (diff)
rework initial sanitycheck to use JSON
Diffstat (limited to 'modules')
-rw-r--r--modules/backend-rpc.php16
1 files changed, 7 insertions, 9 deletions
diff --git a/modules/backend-rpc.php b/modules/backend-rpc.php
index bb76fd168..ea1867e0c 100644
--- a/modules/backend-rpc.php
+++ b/modules/backend-rpc.php
@@ -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;
}