More generally, if you want to serialize objects that don't have plain content, for instances objects containing resources, you need to implement __sleep and __serialize to provide (un)serialize with a means to store what information you want to serialize, because it has no way to get to it on its own.
See http://fr2.php.net/manual/fr/language.oop5.magic.php#language.oop5.magic.sleep This is basically what you work around by converting to XML text: you removed the hidden info, just like a _sleep implementation would do. ________________________________________ De : [email protected] [[email protected]] de la part de Randy Fay [[email protected]] Date d'envoi : mardi 1 décembre 2009 20:49 À : [email protected] Objet : Re: [development] unserialize Your google approach was correct: http://drupal.org/node/529866 has a good rundown on this. I've also had major serialization issues with simplexml. In that case you have to store XML into the cache after converting to xml using simplexml's methodology - you can't just dump a tree into the drupal cache. -Randy On Tue, Dec 1, 2009 at 2:42 PM, Jeff Greenberg <[email protected]<mailto:[email protected]>> wrote: I asked about this at #drupal-support, and am waiting for an answer, but when I Googled it (+unserialize +"Error at offset" +"bootstrap.inc") I received 220,000 postings, so maybe this is a big issue I missed? Unserialize error at offset x of y bytes in boostrap.inc? -- Randy Fay Drupal Development, troubleshooting, and debugging [email protected]<mailto:[email protected]> +1 970.462.7450
