]> git.wh0rd.org - tt-rss.git/blobdiff - functions.php
rework initial sanitycheck to use JSON
[tt-rss.git] / functions.php
index b0c768ff8b77a14d377f508cd854f4964d82233d..1e9e5a576701ae14ba5d10c253714052cf7677b7 100644 (file)
 
        function sanity_check($link) {
 
+               global $ERRORS;
+
                $error_code = 0;
                $schema_version = get_schema_version($link);
 
                        $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) {
                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
         *