more on XML_Serialize/Unserialize
| From: | Alan Knowles | Date: | Wed, 27 Aug 2003 12:57:30 +0000 |
| Subject: | more on XML_Serialize/Unserialize | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-20631@lists.php.net to get a copy of this message | ||
2 more little things..
the docs for serialize indicate that serialize() should return the xml.. - but they dont.. - it would be nice if it did..
* same thing applies for unserialize (although it indicates it returns true) - it would seem obvious for it to return the array.
Id suggest a matching attribute in Serializer keyAttribute
eg.
$valid = XML_Util::isValidName($key);
$atts = array();
if (PEAR::isError($valid)) {
$key = $this->options["defaultTagName"]];
$atts[$this->options["keyAttribute"]]=$origKey;
}these also seemed more sensible defaults.. var $options = array(
"indent" => " ",
"linebreak" => "\n",
"typeHints" => false,
"addDecl" => false,
"defaultTagName" => "array"
"keyAttribute" => "key"
);
for unserialize - I'd switch isFile to true, by default - since it inherits XML_Parser, the default behaviour would more likley be expected to follow that of XML_Parser.
Otherwise I think it's able to serialize and unserialize the data from PHP_Parser - hence the beginnings of a project file... :)
Regards
Alan
--
Can you help out?
Need Consulting Services or Know of a Job?
http://www.akbkhome.com