Can FlatBuffers be used with PHP server side?

1.3k Views Asked by At

I'm writing applications for Android and iOS, until now we were using JSON to pass data between the server and the client apps. Our server is written in PHP. Now I was thinking to move our implementation to FlatBuffers instead of JSON.

Does someone knows if I can produce them using PHP? I'm not a server developer so I have no idea how this works on the server side.

2

There are 2 best solutions below

0
On

There currently is no FlatBuffers code generator for PHP, only C++/Java/C#/Go/Python. The flatc command line tool however can convert a binary flatbuffer file to JSON for use with any language.

EDIT: a PHP implementation was just contributed to the project.

0
On

Yes, you can produce them with php. Google just released a php library.

There are some resources on the projects webpage.

You still need the C compiler to compile the schemas. If you are on a mac you can just install it using brew install flatbuffers (using home brew).