cvs: pear /SOAP Server.php
| From: | Jan Schneider | Date: | Mon, 06 Feb 2006 12:15:23 +0000 |
| Subject: | cvs: pear /SOAP Server.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-38019@lists.php.net to get a copy of this message | ||
yunosh Mon Feb 6 12:15:23 2006 UTC
Modified files:
/pear/SOAP Server.php
Log:
Fix array handling with PHP5 (Bug 6704).
http://cvs.php.net/viewcvs.cgi/pear/SOAP/Server.php?r1=1.62&r2=1.63&diff_format=u
Index: pear/SOAP/Server.php
diff -u pear/SOAP/Server.php:1.62 pear/SOAP/Server.php:1.63
--- pear/SOAP/Server.php:1.62 Mon Jan 16 23:24:08 2006
+++ pear/SOAP/Server.php Mon Feb 6 12:15:23 2006
@@ -310,8 +310,15 @@
}
/**
- * Creates SOAP_Value object with return values from method.
+ * Creates SOAP_Value objects with return values from method.
* Uses method signature to determine type.
+ *
+ * @param mixed $method_response The result(s).
+ * @param array|string $type The type(s) of the return value(s).
+ * @param string $return_name The name of the return value.
+ * @param string $namespace The namespace of the return value.
+ *
+ * @return array List of SOAP_Value objects.
*/
function buildResult(&$method_response, &$return_type,
$return_name = 'return', $namespace = '')
@@ -327,7 +334,7 @@
$key = 'item';
}
if (is_a($method_response[$i], 'SOAP_Value')) {
- $return_val[] = $method_response[$i++];
+ $return_val[] =& $method_response[$i++];
} else {
$qn =& new QName($key, $namespace);
$return_val[] =& new SOAP_Value($qn->fqn(), $type,
$method_response[$i++]);
@@ -343,8 +350,7 @@
$return_type = $values[0];
}
$qn =& new QName($return_name, $namespace);
- $return_val = array();
- $return_val[] =& new SOAP_Value($qn->fqn(), $return_type, $method_response);
+ $return_val = array(new SOAP_Value($qn->fqn(), $return_type, $method_response));
}
}
return $return_val;
@@ -398,7 +404,8 @@
$this->_raiseSoapDefault($hr);
return null;
}
- $header_results[] = array_shift($this->buildResult($hr,
$this->return_type, $header_method, $header_val->namespace));
+ $results = $this->buildResult($hr, $this->return_type,
$header_method, $header_val->namespace);
+ $header_results[] = $results[0];
}
}
}