本文整理汇总了PHP中thrift_protocol_write_binary函数的典型用法代码示例。如果您正苦于以下问题:PHP thrift_protocol_write_binary函数的具体用法?PHP thrift_protocol_write_binary怎么用?PHP thrift_protocol_write_binary使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了thrift_protocol_write_binary函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test
function test()
{
$p = new DummyProtocol();
$v1 = new TestStruct();
$v1->aString = str_repeat('x', 1000000);
thrift_protocol_write_binary($p, 'foomethod', 1, $v1, 20, true);
$p->getTransport()->buff = str_replace(pack('N', 1000000), pack('N', (1 << 32) - 2), $p->getTransport()->buff);
thrift_protocol_read_binary($p, 'TestStruct', true);
}
示例2: serialize
public static function serialize($object)
{
$transport = new TMemoryBuffer();
$protocol = new TBinaryProtocolAccelerated($transport);
if (function_exists('thrift_protocol_write_binary')) {
thrift_protocol_write_binary($protocol, $object->getName(), TMessageType::REPLY, $object, 0, $protocol->isStrictWrite());
$protocol->readMessageBegin($unused_name, $unused_type, $unused_seqid);
} else {
$object->write($protocol);
}
return $transport->getBuffer();
}
示例3: send_close
public function send_close()
{
$args = new \ICANS\Component\IcansLoggingComponent\Flume\ThriftFlumeEventServer_close_args();
$bin_accel = $this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED && function_exists('thrift_protocol_write_binary');
if ($bin_accel) {
thrift_protocol_write_binary($this->output_, 'close', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
} else {
$this->output_->writeMessageBegin('close', TMessageType::CALL, $this->seqid_);
$args->write($this->output_);
$this->output_->writeMessageEnd();
$this->output_->getTransport()->flush();
}
}
示例4: serialize
public static function serialize($object, $disable_hphp_extension = false)
{
$transport = new TMemoryBuffer();
$protocol = new TBinaryProtocolAccelerated($transport);
if (\hacklib_cast_as_boolean(function_exists('thrift_protocol_write_binary')) && !\hacklib_cast_as_boolean($disable_hphp_extension)) {
thrift_protocol_write_binary($protocol, $object->getName(), TMessageType::REPLY, $object, 0, $protocol->isStrictWrite());
$unused_name = $unused_type = $unused_seqid = null;
$protocol->readMessageBegin($unused_name, $unused_type, $unused_seqid);
} else {
$object->write($protocol);
}
return $transport->getBuffer();
}
示例5: send_gen_id
public function send_gen_id()
{
$args = new generator_service_gen_id_args();
$bin_accel = $this->output_ instanceof Thrift\Protocol\TProtocol::$TBINARYPROTOCOLACCELERATED && function_exists('thrift_protocol_write_binary');
if ($bin_accel) {
thrift_protocol_write_binary($this->output_, 'gen_id', Thrift\Type\TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
} else {
$this->output_->writeMessageBegin('gen_id', Thrift\Type\TMessageType::CALL, $this->seqid_);
$args->write($this->output_);
$this->output_->writeMessageEnd();
$this->output_->getTransport()->flush();
}
}
示例6: send_GetPeerStatus
public function send_GetPeerStatus()
{
$args = new ambition_ISearchService_GetPeerStatus_args();
$bin_accel = $this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED && function_exists('thrift_protocol_write_binary');
if ($bin_accel) {
thrift_protocol_write_binary($this->output_, 'GetPeerStatus', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
} else {
$this->output_->writeMessageBegin('GetPeerStatus', TMessageType::CALL, $this->seqid_);
$args->write($this->output_);
$this->output_->writeMessageEnd();
$this->output_->getTransport()->flush();
}
}
示例7: send_getApiVersion
public function send_getApiVersion()
{
$args = new \RedRoma\Aroma\MessageService\MessageService_getApiVersion_args();
$bin_accel = $this->output_ instanceof TBinaryProtocolAccelerated && function_exists('thrift_protocol_write_binary');
if ($bin_accel) {
thrift_protocol_write_binary($this->output_, 'getApiVersion', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
} else {
$this->output_->writeMessageBegin('getApiVersion', TMessageType::CALL, $this->seqid_);
$args->write($this->output_);
$this->output_->writeMessageEnd();
$this->output_->getTransport()->flush();
}
}
示例8: send_getToken
public function send_getToken($userID)
{
$args = new vng_zingme_payment_thrift_TToken_getToken_args();
$args->userID = $userID;
$bin_accel = $this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED && function_exists('thrift_protocol_write_binary');
if ($bin_accel) {
thrift_protocol_write_binary($this->output_, 'getToken', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
} else {
$this->output_->writeMessageBegin('getToken', TMessageType::CALL, $this->seqid_);
$args->write($this->output_);
$this->output_->writeMessageEnd();
$this->output_->getTransport()->flush();
}
}
示例9: send_getdata
public function send_getdata($arg)
{
$args = new TestT_getdata_args();
$args->arg = $arg;
$bin_accel = $this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED && function_exists('thrift_protocol_write_binary');
if ($bin_accel) {
thrift_protocol_write_binary($this->output_, 'getdata', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
} else {
$this->output_->writeMessageBegin('getdata', TMessageType::CALL, $this->seqid_);
$args->write($this->output_);
$this->output_->writeMessageEnd();
$this->output_->getTransport()->flush();
}
}
示例10: send_batchHttpReq
public function send_batchHttpReq($request)
{
$args = new BatchRpcService_batchHttpReq_args();
$args->request = $request;
$bin_accel = $this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED && function_exists('thrift_protocol_write_binary');
if ($bin_accel) {
thrift_protocol_write_binary($this->output_, 'batchHttpReq', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
} else {
$this->output_->writeMessageBegin('batchHttpReq', TMessageType::CALL, $this->seqid_);
$args->write($this->output_);
$this->output_->writeMessageEnd();
$this->output_->getTransport()->flush();
}
}
示例11: send_Search
public function send_Search(\SearchThrift\SearchRequest $Request)
{
$args = new \SearchThrift\SearchService_Search_args();
$args->Request = $Request;
$bin_accel = $this->output_ instanceof TBinaryProtocolAccelerated && function_exists('thrift_protocol_write_binary');
if ($bin_accel) {
thrift_protocol_write_binary($this->output_, 'Search', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
} else {
$this->output_->writeMessageBegin('Search', TMessageType::CALL, $this->seqid_);
$args->write($this->output_);
$this->output_->writeMessageEnd();
$this->output_->getTransport()->flush();
}
}
示例12: send_UpdateState
public function send_UpdateState(\TUpdateStateRequest $request)
{
$args = new \StateStoreSubscriberService_UpdateState_args();
$args->request = $request;
$bin_accel = $this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED && function_exists('thrift_protocol_write_binary');
if ($bin_accel) {
thrift_protocol_write_binary($this->output_, 'UpdateState', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
} else {
$this->output_->writeMessageBegin('UpdateState', TMessageType::CALL, $this->seqid_);
$args->write($this->output_);
$this->output_->writeMessageEnd();
$this->output_->getTransport()->flush();
}
}
示例13: send_Send
public function send_Send(\Impala\Test\ThriftDataParams $params)
{
$args = new \Impala\Test\NetworkTestService_Send_args();
$args->params = $params;
$bin_accel = $this->output_ instanceof TBinaryProtocolAccelerated && function_exists('thrift_protocol_write_binary');
if ($bin_accel) {
thrift_protocol_write_binary($this->output_, 'Send', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
} else {
$this->output_->writeMessageBegin('Send', TMessageType::CALL, $this->seqid_);
$args->write($this->output_);
$this->output_->writeMessageEnd();
$this->output_->getTransport()->flush();
}
}
示例14: send_UpdateState
public function send_UpdateState(\Impala\TUpdateStateRequest $params)
{
$args = new \Impala\StateStoreSubscriber_UpdateState_args();
$args->params = $params;
$bin_accel = $this->output_ instanceof TBinaryProtocolAccelerated && function_exists('thrift_protocol_write_binary');
if ($bin_accel) {
thrift_protocol_write_binary($this->output_, 'UpdateState', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
} else {
$this->output_->writeMessageBegin('UpdateState', TMessageType::CALL, $this->seqid_);
$args->write($this->output_);
$this->output_->writeMessageEnd();
$this->output_->getTransport()->flush();
}
}
示例15: send_retrieve
public function send_retrieve($uid)
{
$args = new example_UserStorage_retrieve_args();
$args->uid = $uid;
$bin_accel = $this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED && function_exists('thrift_protocol_write_binary');
if ($bin_accel) {
thrift_protocol_write_binary($this->output_, 'retrieve', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
} else {
$this->output_->writeMessageBegin('retrieve', TMessageType::CALL, $this->seqid_);
$args->write($this->output_);
$this->output_->writeMessageEnd();
$this->output_->getTransport()->flush();
}
}