Hi

2014-09-23 23:56 GMT+02:00 Park Framework <park.framew...@gmail.com>:
> In php.ini add the directive
> serialization.method = msgpack / Igbinary / ....

There is an even better way to do this; add an additional parameter to
serialize and unserialize to serialize as and unserialize as:

$bin = serialize($data_struct, 'igbinary');
$data_struct = unserialize($bin, 'igbinary');

This keeps a clean BC solution without adding more clutter to the ini
file for runtime things, you could say that adding something like
'serialize_default_mode = php;', but changing its default would create
clutter code where the optional second parameter would be forced, so
lets leave the ini out of this.

So what I propose here is:
1) An internal API to register serializes,and making PHP's current
serialize implemented as such
2) Add a second parameter to both serialize and unserialize that can
be used choose a serializer
3) Optionally add a function like: get_serialize_handlers() (so we
won't have to parse phpinfo()) which are the available serializers
4) Consider bundling either igbinary, msgpack or implement a new
custom and more efficient one that allows us to be future oriented
5) No php.ini changes
6) Allow users to register serialize handlers using
register_serialize_handler()/unregister_serialize_handler()
7) Optionally consider implementing this in SPL

Okay, late night, back to sleep!


-- 
regards,

Kalle Sommer Nielsen
ka...@php.net

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to