X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2FRequest.php;h=b3b8112afc0ef1d16248a8ddc7c12ed5329dc938;hb=7fbd194478e080d624bab075d189bf3ba215325d;hp=42ed0757b9d36a3cd3b73815859303482f5bfe18;hpb=f4978078febfc4289bb4f45db6ca3f9e6c8c4f94;p=plcapi.git diff --git a/src/Request.php b/src/Request.php index 42ed075..b3b8112 100644 --- a/src/Request.php +++ b/src/Request.php @@ -8,7 +8,7 @@ use PhpXmlRpc\Helper\Logger; use PhpXmlRpc\Helper\XMLParser; /** - * This class provides a representation for a request to an XML-RPC server. + * This class provides the representation of a request to an XML-RPC server. * A client sends a PhpXmlrpc\Request to a server, and receives back an PhpXmlrpc\Response. */ class Request @@ -109,7 +109,7 @@ class Request */ public function addParam($param) { - // add check: do not add to self params which are not xmlrpc values + // check: do not add to self params which are not xmlrpc values if (is_object($param) && is_a($param, 'PhpXmlRpc\Value')) { $this->params[] = $param; @@ -288,7 +288,7 @@ class Request xml_set_default_handler($parser, 'xmlrpc_dh'); // first error check: xml not well formed - if (!xml_parse($parser, $data, count($data))) { + if (!xml_parse($parser, $data, 1)) { // thanks to Peter Kocks if ((xml_get_current_line_number($parser)) == 1) { $errStr = 'XML error at line 1, check URL'; @@ -298,7 +298,7 @@ class Request xml_get_current_line_number($parser), xml_get_current_column_number($parser)); } error_log($errStr); - $r = new Response(0, PhpXmlRpc::$xmlrpcerr['invalid_return'], PhpXmlRpc::$xmlrpcstr['invalid_return'] . ' (' . $errStr . ')'); + $r = new Response(0, PhpXmlRpc::$xmlrpcerr['invalid_return'], PhpXmlRpc::$xmlrpcstr['invalid_return'] . ' ' . $errStr); xml_parser_free($parser); if ($this->debug) { print $errStr; @@ -334,8 +334,7 @@ class Request ); } - // note that using =& will raise an error if $xmlRpcParser->_xh['st'] does not generate an object. - $v = &$xmlRpcParser->_xh['value']; + $v = $xmlRpcParser->_xh['value']; if ($xmlRpcParser->_xh['isf']) { /// @todo we should test here if server sent an int and a string, and/or coerce them into such... @@ -380,10 +379,10 @@ class Request /** * Enables/disables the echoing to screen of the xmlrpc responses received. * - * @param integer $in values 0, 1, 2 are supported + * @param integer $level values 0, 1, 2 are supported */ - public function setDebug($in) + public function setDebug($level) { - $this->debug = $in; + $this->debug = $level; } }