AW: AW: AW: [PEAR-DEV] [RfC] XML_Serializer
| From: | Stephan Schmidt | Date: | Tue, 29 Jul 2003 12:18:11 +0000 |
| Subject: | AW: AW: AW: [PEAR-DEV] [RfC] XML_Serializer | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-18877@lists.php.net to get a copy of this message | ||
Hi,
> I wonder why you can't unserialize? I mean PHP is loosely typed anyways,
> theres also reflection (is_int(), is_string(), etc) and just adding a
> single attribute to the root class like "type" you can have this:
>
> <userObject type="object">
> <user>Davey</user>
> <name>Davey Shafik</name>
> <email>davey@php.net</email>
> </userObject>
>
> easily translate back to an object with user, name and e-mail properties
> using $userObject = new stdClass; $userObject->user = $xml_user; etc
I already did something like this (patConfiguration), it's not in PEAR but
can be downloaded at http://www.php-tools.net.
But this is not what the package is intended to do. I need it, as I'm
working on a class that creates WordXML files and there I do not want any
additional attributes.
> Then it is not a serializer IMO, without an unserializer and the fact
> you say its <quote>something totally different</quote> to WDDX which
> *is* a serializer it cannot be.
But it surely does serialize any structure in an XML format, so it is a
serializer. Who said that a serializer needs an unserializer?
> I propose a new name: Structure_XML or XML_Data_Structure or if you WANT
> it to be a Structure to XML package rather than representing PHP
> Structures in XML then perhaps XML_From_Structure? If you do mean this
> latter then again, its innapropriately named/called a serializer
Then I think a better name would be XML_Tag_Creator. XML_From_Structure
could scare people who only need a class that helps them generating XML
documents from any data...
> Also, on a side note, why does this exist?
> http://pear.php.net/package-info.php?package=XML_Serializer -
> until it
> has been explicitly said that the package is to be released I don't
> think we should create these "accounts", or even better till the first
> release, I mean look at Crypt_Crypt... its been there months with nothing.
I already got 5 +1's last night and nobody complained about the name, only
about the static method calls and the global variable, which will be removed
and that's what is needed to release a package. I planned on releasing a
first alpha version this evening so there won't be months with nothing.
I could offer you to add an special option that will add a type attribute to
the XML tags. This will allow me to add an unserializer. So everybody could
use this class in the way he wants to, either just to create any XML file or
as a replacement for WDDX...
Stephan