[development] Add data to Drupal session

Sascha Grossenbacher saschagros at gmail.com
Wed Dec 9 08:35:37 UTC 2009


On Wed, Dec 9, 2009 at 6:57 AM, Larry Garfield <larry at garfieldtech.com> wrote:
> It's true that resources like DB connections or file handles don't survive
> serialization.  That's why PHP offers the __sleep() and __wakeup() magic
> methods that you can use to control what gets serialized or deserialized if
> necessary.  You can find more on them on http://www.php.net/

Correct. But the main thing an XMPP class does is maintaining a
connection (which is a resource) to the XMPP server. And If I
understood the thread starter correctly, the idea is to avoid the
connection initialization. I'm doing something similiar right now and
in my case, initalizing the connection to the server takes ~40% of the
whole request time. If I have to do that in every __wakeup() call, I
don't gain anything.


More information about the development mailing list