Re: Activation of IGBinary serialization extension in 5.4 by default

From: Date: Fri, 19 Aug 2011 12:04:31 +0000
Subject: Re: Activation of IGBinary serialization extension in 5.4 by default
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
On Fri, Aug 19, 2011 at 1:42 PM, Paul Dragoonis <[email protected]> wrote:
> On Fri, Aug 19, 2011 at 12:36 PM, Pierre Joye <[email protected]> wrote:
>
>> On Fri, Aug 19, 2011 at 1:28 PM, Sebastian Bergmann <[email protected]>
>> wrote:
>> > Am 18.08.2011 13:12, schrieb Paul Dragoonis:
>> >> Here we get a great perf boost, and what's more excellent as we don't
>> have
>> >> to break BC to get there!
>> >
>> >  Are you sure it does not break BC? Does http://bit.ly/nIRxqz still work
>> >  with IGBinary, for instance?
>>
>> That obviously won't work as long as igbinary is used. It is covered
>> by the  "interop" or BC break parts in my initial reply.
>>
>
> So far, it looks like this "transparent" upgrade isn't that transparent
> anymore and will result in BC breaks. New approaches must be thought of.
>
> Like Pierre said, there will be new serialization engines in the future so
> it makes no sense to add more functions like serialize_binary() or whatnot.
>
> I think we need to keep our code base identical and maintain the
> serialize_handler via our php.ini configuration.

this could still cause problems, as pointed out before (when you
change your handler, or when you pass serialized data between
different php installs, etc.), so I really like what Kiall Mac Innes
suggested: prefix the data with the serializer identifier.
if it is missing,  then it was serialized with the old method, if it
is present, the appropriate method should be used, if the serializer
ident is there but unknown, then exit with a fatal error telling the
user that the custom handler is missing.

the downside would be that if you want to serialize/unserialize the
data outside of php, your implementation should take care of this
prefix.
just a wild idea, but maybe useful:
instead of creating a prefix, we could serialize the passed data with
the given(php, igbinary, etc.) handler, then wrap the whole stuff into
an array which holds the name of the used handler and the serialized
data, and serialize this array with the old(php) serialize method.
this way the datablob would be always a valid serialized string, and
would be easier to get the serialize method than with the prefixing.

-- 
Ferenc Kovács
@Tyr43l - http://tyrael.hu


Thread (34 messages)

« previous php.internals (#54723) next »