Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:26828 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93963 invoked by uid 1010); 7 Dec 2006 11:26:38 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 93948 invoked from network); 7 Dec 2006 11:26:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Dec 2006 11:26:38 -0000 Authentication-Results: pb1.pair.com header.from=robert@interjinn.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=robert@interjinn.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain interjinn.com from 66.11.173.122 cause and error) X-PHP-List-Original-Sender: robert@interjinn.com X-Host-Fingerprint: 66.11.173.122 unknown Linux 2.5 (sometimes 2.4) (4) Received: from [66.11.173.122] ([66.11.173.122:44014] helo=blobule.interjinn.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 75/32-13900-B4AF7754 for ; Thu, 07 Dec 2006 06:26:38 -0500 Received: by blobule.interjinn.com (Postfix, from userid 2000) id D05D55AD20E; Thu, 7 Dec 2006 06:26:07 -0500 (EST) To: Thomas Seifert Cc: internals@lists.php.net In-Reply-To: <1B.40.13900.C4CE7754@pb1.pair.com> References: <0c60b01d19ec7e242ade31e29120ee27@gravitonic.com> <1B.40.13900.C4CE7754@pb1.pair.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: InterJinn Date: Thu, 07 Dec 2006 06:26:06 -0500 Message-ID: <1165490767.28927.13.camel@blobule> Mime-Version: 1.0 X-Mailer: Evolution 2.8.1 Subject: Re: [PHP-DEV] PHP 5.2: Serialization patch From: robert@interjinn.com (Robert Cummings) On Thu, 2006-12-07 at 11:25 +0100, Thomas Seifert wrote: > >From a users point of view: you must be kidding, eh? > You want to break all the strings which were stored serialized in the > 5.x-series? I can understand that it will break in php6 but not in some > minor release. > It will cause havoc with a lot of apps which can't read their cached- / > meta-data anymore. > > Also the performance drawback will get you a lot of angry users. > Wasn't that just some versions before when the serialization has gotten > a lot slower and created lots of problems? This is a forwards compatibility issue, if we don't care about version less than or equal to 5.2 being able to understand serialized data from future version then there shouldn't be a problem with backwards compatibility. I propose checking the start of the string to be unserialized for the character v, if found then we can parse out a version number up to the first found comma (or some other delimiter). So for example we have echo serialize( array( 1, 2, 3, 4 ) ); -> a:4:{i:0;i:1;i:1;i:2;i:2;i:3;i:3;i:4;} The new system could have: -> v:5.21,a:4:{i:0;i:1;i:1;i:2;i:2;i:3;i:3;i:4;} Then in newer version of unserialize the version of 5.21 can be extracted and the appropriate unserialization can occur. If no version info is found then fall back to original semantics. Cheers, Rob. -- .------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `------------------------------------------------------------'