Topic: [Igbinary] How to unserialize igbinary in C++ project

Firstly,  I admire you very much and thanks for you share of igbinary lib.

And my problem is how to unserialiize igbinary in C++ project? Thanks for you help.

Re: [Igbinary] How to unserialize igbinary in C++ project

Sorry, but I don't really understand your question.

igbinary is only a PHP extension, doesn't make sense for other language.

Anotther PHP extension can, of course, use its public API (see igbinary.h)

IGBINARY_API int igbinary_serialize(uint8_t **ret, size_t *ret_len, zval *z TSRMLS_DC);
IGBINARY_API int igbinary_serialize_ex(uint8_t **ret, size_t *ret_len, zval *z, struct igbinary_memory_manager *memory_manager TSRMLS_DC);
IGBINARY_API int igbinary_unserialize(const uint8_t *buf, size_t buf_len, zval *z TSRMLS_DC);
Desktop: Fedora 25 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 24 x86_64 + remi (SCL only)
Hosting Server: CentOS 6.8 x86_64 + EPEL + remi + remi-php70

3 (edited by shilei 2017-05-27 10:16:49)

Re: [Igbinary] How to unserialize igbinary in C++ project

Thanks for your reply.  My scene is our product logic involving multiple teams.  Team A use php extension igbinary to insert data into redis. Then Team B want to read data from redis in C++ module. Is it feasible for Team B?

Re: [Igbinary] How to unserialize igbinary in C++ project

So,  Team B need unserialize igbinary in C++ module. Could you give me some suggestion.  Thanks.

Re: [Igbinary] How to unserialize igbinary in C++ project

Sorry, I can't really help you, but probably you should investigate on another serializer, json is probably the most portable, msgpack could also be interesting (as, AFAIK, it is available for various languages). I really think igbinary is not suitable for such cross-languages needs.

Desktop: Fedora 25 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 24 x86_64 + remi (SCL only)
Hosting Server: CentOS 6.8 x86_64 + EPEL + remi + remi-php70

6 (edited by shilei 2017-05-28 02:25:54)

Re: [Igbinary] How to unserialize igbinary in C++ project

Remi, thanks.

Because the serialize algorithm and the unserialize algorithm are in different teams .  I cannot drive the serialize team upgrade their  algorithm. At the same time, I cannot migrate my team source code from C++ to PHP.

Is there any other ideas to implement unserialize algorithm in C++ project, such as modify the igbinary.c source code. And How big is the cost for me? Thanks again.

Re: [Igbinary] How to unserialize igbinary in C++ project

> such as modify the igbinary.c source code

Everything is doable, but this code is design to create PHP variables (ZVAL = scalar, array or object)

> And How big is the cost for me ?

No idea.

Desktop: Fedora 25 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 24 x86_64 + remi (SCL only)
Hosting Server: CentOS 6.8 x86_64 + EPEL + remi + remi-php70