Can I directly serialize to a file using PHP's thrift library?

半世苍凉 提交于 2019-12-06 13:12:58

Try extending TPhpStream by overriding:

private static function inStreamName() {
    if (php_sapi_name() == 'cli') {
      return 'php://stdin';
    }
    return 'php://input';   }

and you would also probably need to alter open method to open write file of your choosing. In case you need it, here is nice tutorial about php streams.

If that does not work out for you, consider using TMemoryBuffer to serialize to string, and than you will find your way to put that into a file.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!