Issue Type: Improvement Created: 2009-07-01T13:36:19.000+0000 Last Updated: 2012-11-20T20:53:07.000+0000 Status: Closed Fix version(s): Reporter: Barry Ruffner (bruffner) Assignee: None Tags: - Zend_Service_Nirvanix
Related issues: Attachments:
In the Nirvanix web services arrays can be passed to avoid having to call the same call multiple times. The setParameterPost does not pass the parameters when passing a sub-array to the method. To change the behavior a new method is introduced below that parses the parameters and constructs the HTTP POST body directly taking the sub-array into account.
Changes:
Line 132 /trunk/library/Zend/Service/Nirvanix/Namespace/Base.php
Line 171 /trunk/library/Zend/Service/Nirvanix/Namespace/Base.php
/**
* The httpClient->setParametersPost does not handle arrays properly when
* passing a subarray in the value. This method handles the parameter
* parsing to take this into account.
*
* @param array $params Parameter array containing the name value pairs
* @return string URL Encoded string for the HTTP POST Body.
*/
private function _getBody($params)
{
foreach ($params as $name => $value) {
if (is_array($value)) {
foreach ($value as $k => $value) {
$paramstr .= '&' . urlencode($name) . '=' . urlencode($value);
}
} else {
$paramstr .= '&' . urlencode($name) . '=' . urlencode($value);
}
}
return $paramstr;
}
Unit Test:
New file: /trunk/tests/Zend/Service/Nirvanix/parameterTest.php
\* If you did not receive a copy of the license and are unable to \* obtain it through the world-wide-web, please send an email \* to license@zend.com so we can send you a copy immediately. \* \* @category Zend \* @package Zend\_Service \* @subpackage Nirvanix \* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. ( [1] => SimpleXMLElement Object
(
[Type] => MD5
[Value] => KpY3FwasAWNyyIXIBmsTEg==
)
[2] => SimpleXMLElement Object
(
[Type] => te&xture
[Value] => smooth
)
)
)
)
Posted by Rob Allen (rob) on 2012-11-20T20:53:07.000+0000
Bulk change of all issues last updated before 1st January 2010 as "Won't Fix".
Feel free to re-open and provide a patch if you want to fix this issue.