16 foreach ($argv as $js_file) {
17 $js = file_get_contents($js_file);
19 error_log(sprintf(
"Error reading content from '%s'.", $js_file));
25 $js_dec = json_decode($js,
true);
26 if ($js_dec === null) {
27 error_log(sprintf(
"Error decoding json from '%s': %s.", $js_file,
json_last_errmsg()));
51 if ($errcode === null) {
52 $errcode = json_last_error();
56 return 'JSON_ERROR_NONE';
59 case JSON_ERROR_DEPTH:
60 return 'JSON_ERROR_DEPTH';
63 case JSON_ERROR_STATE_MISMATCH:
64 return 'JSON_ERROR_STATE_MISMATCH';
67 case JSON_ERROR_CTRL_CHAR:
68 return 'JSON_ERROR_CTRL_CHAR';
71 case JSON_ERROR_SYNTAX:
72 return 'JSON_ERROR_SYNTAX';
76 return 'JSON_ERROR_UTF8';
79 return sprintf(
"error code '%s'", $errcode);
json_last_errmsg($errcode=null)
foreach($argv as $js_file) if(count($js_out)<=0) $js_enc