Re: [PHP4BETA] Session: objects containing objects
| From: | thies at digicol dot de | Date: | Thu, 24 Feb 2000 09:00:06 +0000 |
| Subject: | Re: [PHP4BETA] Session: objects containing objects | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-10806@lists.php.net to get a copy of this message | ||
On Thu, Feb 24, 2000 at 09:18:56AM +0000, Ulf Wendel wrote:
> Hi,
>
> will an object containing other object be correctly stored in a session?
>
> To implement this on the user side - e.g. in PHPLIB - you'd need some
> very few functions for introspection:
>
> - getFields|Slots ( object $obj )
> returns all fields of an object
>
> - getFieldtype|Slottype ( field $field )
> analogous to getType()
>
> - getConstructorCall ( object $obj )
> returns the constructor parameters used to construct the current object.
> This could be emulated by telling each class that wants to be serialized
> it has to save the contruction call in a certain slot such as phplib
> does with the slots that are requestet to be serialized (
> $persistent_slot = array() ) .
>
>
> - getChildren ( object $obj )
> return array of children of the current object. This could be emulated
> with getFields()/getFieldtype() calls, but...
>
> I know in PHP3 I can tread an object as an array which gives me a way to
> live without the above basic functions for introspection, but it's not
> warrantied that an object can always be treaded like an array, right?
>
> Please don't tell me the OO features of PHP are limited by design. Is it
> really that difficult to implement the for the purpose of serialization
> most important function getFields()? By the way Java is able to
> serialize object containing objects...
ulf - this is not a language question but a question
regarding the serializer/unserializer used by the
session-module. currently we support the builtin serialize()
and wddx modules.
i would like to add the needed functionality to PHP 4 so that
phplib can be used with "native" session support.
as i've never used phplib myself could you please send me
some tiny sample files that show the extra features of
phplib's serializer opposed to PHP 4's?
regards
>
> Ulf
>
> --
> PHP 4.0 Beta Mailing List <http://www.php.net/version4/>
> To unsubscribe, e-mail: php4beta-unsubscribe@lists.php.net
> For additional commands, e-mail: php4beta-help@lists.php.net
> To contact the list administrators, e-mail: php4beta-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