diff --git a/helpers.inc.php b/helpers.inc.php index d0034f0..ff041e9 100644 --- a/helpers.inc.php +++ b/helpers.inc.php @@ -665,45 +665,6 @@ function git_try_commit($files, $msg) } } -function decode_json_ensure($json, $assoc = false) -{ - $res = json_decode($json, $assoc); - if($res === null) - { - $parser = new JsonParser(); - $err = $parser->lint($json); - echo $json; - throw $err; - } - return $res; -} - -function convert_js_to_msgpack($file, $bin_file) -{ - $bin_file = "$file.lib"; - if(need_to_regen($bin_file, array($file))) - { - echo "Converting $file -> $bin_file...\n"; - $data = decode_json_ensure(file_get_contents($file)); - $msg = config_msgpack_pack($data); - ensure_write($bin_file, $msg); - } - return true; -} - -function check_and_decode_json($json) -{ - try - { - $arr = decode_json_ensure($json, true); - return array(0, "", $arr); - } - catch(Exception $e) - { - return array(1, $e->getMessage(), array()); - } -} - function check_and_decode_jzon($json) { try