hehewf
V2EX  ›  PHP

有没有使用过 drslump/Protobuf- PHP 的,求大神指教。

  •  
  •   hehewf · Mar 6, 2017 · 3564 views
    This topic created in 3379 days ago, the information mentioned may be changed or developed.
    已生成 proto 对应的 php 文件,调用方法 serializeToString 没有反应,报错也没有。
    Supplement 1  ·  Mar 15, 2017
    已经解决。使用 allegro/php-protobuf 的 serializeToString 方法。(需求是: php 与 C++的 socket 通讯——内容体使用 protobuf 存储。)自己整理一下文章,比较杂乱,用需要的可以看一眼,提提建议。 http://www.diyisite.com/index.php/Home/Article/index/id/88.html
    4 replies    2017-03-15 09:11:02 +08:00
    crystom
        1
    crystom  
       Mar 6, 2017   ❤️ 1
    只有 serialize 方法
    hehewf
        2
    hehewf  
    OP
       Mar 12, 2017
    @crystom 已经解决了。 php 开启了 protobuf 的拓展以后,就有了 serializeToString 这个方法。 protobuf 一开始没有搞好。现在可以了。
    crystom
        3
    crystom  
       Mar 15, 2017   ❤️ 1
    @hehewf 你用 allegro/php-protobuf 的话确实是 serializeToString 方法,不过用 drslump/Protobuf- PHP 或者其 fork 版本的话,是 serialize 方法
    hehewf
        4
    hehewf  
    OP
       Mar 15, 2017
    @crystom 嗯嗯。已经解决。用的是 allegro/php-protobuf 的 serializeToString 方法。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2945 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 06:42 · PVG 14:42 · LAX 23:42 · JFK 02:42
    ♥ Do have faith in what you're doing.