简体   繁体   English

基于PHP的thrift API客户端,如python中的thirft.apache.org示例客户端

[英]PHP based thrift API client like thirft.apache.org example client in python

I want to write PHP based thrift API client like thirft.apache.org example client in python at: http://thrift.apache.org/ 我想在python中编写基于PHP的thrift API客户端,例如thirft.apache.org示例客户端: http ://thrift.apache.org/

I write this code: 我写这段代码:

      //A struture
      $up = UserProfile($uid=1,
             $name="Mark Slee",
             $blurb="I'll find something to put here.");

      # Talk to a server via TCP sockets, using a binary protocol
      $fp = fsockopen("localhost",9090, $errno, $errstr, 90);
      # Use the service we already defined
      $service=fwrite($fp, $up);

      while (!feof($fp)) {
          echo fgets($fp, 128);
      }

so is it correct alternative of python client code at : http://thrift.apache.org/ 所以它是python客户端代码的正确替代品: http//thrift.apache.org/

Please give any suggestion as I am new to it. 因为我是新手,请给出任何建议。

thanks 谢谢

Look in the Thrift Wiki at the Thrift Usage page. Thrift Usage页面查看Thrift Wiki That has examples in many supported languages, in particular, there's an example client in PHP . 这在许多支持的语言中有例子,特别是在PHP中有一个示例客户端

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM