Re: AW: [PEAR-DEV] [RfC] XML_Serializer
| From: | Alan Knowles | Date: | Mon, 28 Jul 2003 23:14:17 +0000 |
| Subject: | Re: AW: [PEAR-DEV] [RfC] XML_Serializer | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-18857@lists.php.net to get a copy of this message | ||
yeah, cute:)
one thought was on exporting objects to xml was to follow the following rules
a) use an option var to map classname=>'toXMLmethod'
-- if this is set use it. (if it returns an array, - use that via the serialize array method..)
b) attempt to look for a toXML method
-- if there is one - use it.
c) fallback to get_object_vars..
+1 = I can see this being usefull for a few things..
Regards
Alan
Stephan Schmidt wrote:
Hi,Love it already :-) You have my +1 IF you remove that ugly $GLOBALS[] usage. Just add some class vars for the options and set them in the constructor or via an extra "_setOptions()" method (called by the constructor). Thus you can also get rid of "_adjustOptions()", since you can simply leave the default class-vars values.I was thinking about this, but then there's no way to call the methods statically.BTW... also having a matching UNserializer would be really cool...That's not easy, as there's no type information stored in the XML documents. You may want to take a look at patConfiguration, which allows you to "unserialize" an XML document. Download it at http://www.php-tools.de Stephan