From 4f5638821868516d272f133f1ea5aebd4be44a9c Mon Sep 17 00:00:00 2001 From: Pavel Shevaev Date: Fri, 2 Jun 2023 15:57:07 +0300 Subject: [PATCH] Removing obsolete unused stuff --- helpers.inc.php | 39 --------------------------------------- 1 file changed, 39 deletions(-) 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