For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > November 2004 > XML_Serilaizer - Problem with PEAR::setErrorHandling









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author XML_Serilaizer - Problem with PEAR::setErrorHandling
Georg Bez

2004-11-25, 3:56 pm

Hi,
i use the function to intercept PEAR::setErrorHandling around
appearing mistakes and to evaluate.
This leads by the using XML_Serilaizer to problems.

If i give the Serilaizer a multi one dimensional array hand
over my program is broken off by a an "error" while testing,
within the class XML_Serilaizer, with the function
XML_Util::isValidName.

Would it be better to produce on these places no error object?
Is this a problem on mine or on the side of the class?

Kind Regards
Georg
Lukas Smith

2004-11-25, 3:56 pm

Georg Bez wrote:
> Hi,
> i use the function to intercept PEAR::setErrorHandling around
> appearing mistakes and to evaluate.
> This leads by the using XML_Serilaizer to problems.
>
> If i give the Serilaizer a multi one dimensional array hand
> over my program is broken off by a an "error" while testing,
> within the class XML_Serilaizer, with the function
> XML_Util::isValidName.
>
> Would it be better to produce on these places no error object?
> Is this a problem on mine or on the side of the class?


I have already send stefan a patch for this.
Essentially what is missing are expectError()/popExpect() calls around
the method call.

RCS file: /repository/pear/XML_Serializer/Serializer.php,v
retrieving revision 1.26
diff -u -r1.26 Serializer.php
--- Serializer.php 6 Nov 2004 15:49:52 -0000 1.26
+++ Serializer.php 25 Nov 2004 13:19:20 -0000
@@ -430,7 +430,9 @@
// copy key
$origKey = $key;
// key cannot be used as tagname => use default tag
+ $this->expectError(array(.. lots of error codes that
XML_Util::isValidName may throw));
$valid = XML_Util::isValidName($key);
+ $this->popExpect();
if (PEAR::isError($valid)) {
if ($this->options['classAsTagName'] &&
is_object($value)) {
$key = get_class($value);

regards,
Lukas
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com