Re: Re: RE: [PHP-GENERAL] Re: [PHP-DEV] S essions and Objects

From: Date: Mon, 19 Jun 2000 14:34:57 +0000
Subject: Re: Re: RE: [PHP-GENERAL] Re: [PHP-DEV] S essions and Objects
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-2198@lists.php.net to get a copy of this message
On Mon, Jun 19, 2000 at 10:37:47AM -0400, Millaway, John wrote: > > > > Let me ask you then, what exactly do you want to see improved? > > > > 1. References are lost during serialization. Example: > > class UserInfo { > var $firstname, $fname; > > function UserInfo() { > $fname = &$firstname; // Create reference > } > } > The alias "fname" will not work correctly in the > next page request. hmm - that would be rather hard to implement. i think you can always find a nice workaround using __sleep and __wakeup (see below) > > > 2. Notification of session events. Ideally, an > object which has been deserialized would be > notified of this, either externally through > a registered callback, or introspectively by > calling an object's "onDeserialization()" > method. > > 3. Per-object serialization. PHP's introspection > functionality is powerful enough to detect if an > object has a "[de]serialize()" method, for example. > If so, the object can provide it's own > [de]serialization. It would be nice if the session > handler could do this automatically. try __sleep() and __wakeup() see attached sample > > -John > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net -- Thies C. Arntzen "One Big-Mac, Small Fries and a Coke!" Digital Collections Phone +49 40 235350 Fax +49 40 23535180 Hammerbrookstr. 93 20097 Hamburg / Germany

Attachment: [application/x-httpd-php] sleep.php
« previous php.general (#2198) next »