Example #1
0
 protected function untransform($data)
 {
     // UNSAFE
     foreach ($this->readTrans_ as $trans) {
         switch ($trans) {
             case self::ZLIB_TRANSFORM:
                 $data = gzuncompress($data);
                 break;
             case self::SNAPPY_TRANSFORM:
                 $data = snuncompress($data);
                 break;
             default:
                 throw new TApplicationException('Unknown transform during recv', TTransportException::INVALID_TRANSFORM);
         }
     }
     return $data;
 }
Example #2
0
 protected function untransform($data)
 {
     // UNSAFE: the only way we know that these possibly iterated compressors
     // will produce reeasonable results is by complicated promises of the way
     // thrift sets things up, which Hack has no way to understand.
     foreach ($this->readTrans_ as $trans) {
         switch ($trans) {
             case self::ZLIB_TRANSFORM:
                 $data = gzuncompress($data);
                 break;
             case self::SNAPPY_TRANSFORM:
                 $data = snuncompress($data);
                 break;
             default:
                 throw new TApplicationException('Unknown transform during recv', TTransportException::INVALID_TRANSFORM);
         }
     }
     return $data;
 }