Пример #1
0
 public static function deserialize($str, $object, $override_version = null, $disable_hphp_extension = false)
 {
     $transport = new TMemoryBuffer();
     $protocol = new TCompactProtocolAccelerated($transport);
     $use_hphp_extension = \hacklib_cast_as_boolean(function_exists('thrift_protocol_read_compact')) && !\hacklib_cast_as_boolean($disable_hphp_extension);
     if ($override_version !== null) {
         $protocol->setWriteVersion($override_version);
         if (!\hacklib_cast_as_boolean(function_exists('thrift_protocol_set_compact_version'))) {
             $use_hphp_extension = false;
         }
     }
     if (\hacklib_cast_as_boolean($use_hphp_extension)) {
         $protocol->writeMessageBegin('', TMessageType::REPLY, 0);
         $transport->write($str);
         $object = thrift_protocol_read_compact($protocol, get_class($object));
     } else {
         $transport->write($str);
         $object->read($protocol);
     }
     return $object;
 }
Пример #2
0
 public function __construct($trans)
 {
     parent::__construct($trans);
 }