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 --- modules/backend-rpc.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'modules/backend-rpc.php') 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 ""; - if (sanity_check($link)) { - print ""; + $reply = array(); - print ""; + $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 ""; + print json_encode($reply); return; } -- cgit v1.2.3