-- Aleš Lončar <
[hidden email]> wrote
(on Friday, 14 March 2008, 10:27 AM +0100):
> After updating to ZF 1.5RC3 Zend_XmlRpc_Client starts to throw exceptions
> whenever empty array value was passed in as parameter. Empty array should
> be convertet to XML-RPC type array, but is convertet to XML-RPC type
> struct.
>
> I've looked into svn log. This happened in revision 8614 when matthew
> merged to release branch.
That particular changeset was made to speed up differentiating arrays
from structs, and utilizes a tried-and-true approach for doing so.
Now, from what I can tell, however, the issue is with empty arrays that
are passed in, and that leaves us with a pretty huge issue: is an empty
array treated as a struct or as an array?
Clearly, the code as provided will treat it as a struct, because it's
comparing:
array() TO array(0)
But even if we were comparing array() to array(), would the value
represent a struct or an array? Rolling back the changeset would help
only the case of an empty array being passed, but not an empty struct.
I'm unsure how to correct the issue, honestly. Since PHP does not
differentiate between arrays and hashes, an empty array() could
represent either. Probably the only good solution is to add some checks
in Zend_XmlRpc_Client to allow either any empty
Zend_XmlRpc_Value_Collection be considered valid when either a struct or
array is expected.
In the meantime, is it possible for you to send other values other than
an empty array? For instance, is that parameter optional? or can it
accept other values?
<snip>
> Another strange one is this.
> If i try to create XmlRpc Value explicit:
> $args = array(
> $aRemoteInfo,
> $what,
> $campaignid,
> $target,
> $source,
> (bool)$withText,
> new Zend_XmlRpc_Value_Array($xmlContext)
> );
>
> Fatal Error is produced.
>
> Fatal error: Class 'Zend_XmlRpc_Value_Collection' not found in
> D:\library\Zend Framework\library\Zend\XmlRpc\Value\Struct.php on line 36
> !!
I cannot reproduce this. Looking in Zend/XmlRpc/Value/Struct.php,
there's a definite require_once 'Zend/XmlRpc/Value/Collection.php', and
that file itself has appropriate require statements to get its
dependencies.
--
Matthew Weier O'Phinney
PHP Developer |
[hidden email]
Zend - The PHP Company |
http://www.zend.com/