/** * Decompress input data * * @param $Input * The data to decompress */ public function Decompress() { $Result = false; try { switch ($this->CompressionMethod) { case Request::CT_NONE: $Result = true; break; case Request::CT_JSEND: $jSEND = new \ThirdParty\jSEND(); $this->Data = $jSEND->getData($this->Data); $Result = true; break; default: throw new \Exception('Compression type not valid'); break; } } catch (\ErrorException $e) { throw new \Exception($e->getMessage() . ' in ' . $e->getFile() . ' at line ' . $e->getLine()); } catch (\Exception $e) { throw new \Exception('Failed to decompress request : ' . $this->Data); } return $Result; }
<?php include '../ThirdParty/jsend.class.php'; $data = $_POST["data"]; // Checks, Validation etc. $jSEND = new \ThirdParty\jSEND(); $str = $jSEND->getData($data); ?> <html> <head> <title>jSEND Decompression Utility</title> </head> <body> <h2>from jSend</h2> <form action="jSendDecompression.php" method="post"> Data:<br/> <textarea name="data" style="height: 150px; width: 300px;"><?php echo $str; ?> </textarea> <button type="submit">Convert to json</button> <button type="submit" id="convertJsend">Convert to jSend</button> </form> <script src="http://code.jquery.com/jquery-1.5rc1.js"></script> <script src="../../WebClient/js/jsend.min.js"></script> <script> $(function () { $("#convertJsend").click(function (e) {