function loadJson($path) { if (!is_readable($path)) { throw new Exception("File {$path} cannot be read", 1); } $str = file_get_contents($path); try { $obj = decodeJson($str); } catch (Exception $e) { $msg = jsonErrorMessage($e->getCode()); throw new Exception("JSON error in {$path}: {$msg}", 2, $e); } return $obj; }
protected function _DECODE_JSON($elem) { return self::import(decodeJson($elem[SIGN_CDATA])); }