|
| __construct ($methodName, $params=array()) |
|
& | __get ($name) |
|
| __isset ($name) |
|
| __set ($name, $value) |
|
| __unset ($name) |
|
| addParam ($param) |
| Add a parameter to the list of parameters to be used upon method invocation.
|
|
| createPayload ($charsetEncoding='') |
|
| getNumParams () |
| Returns the number of parameters in the message.
|
|
| getParam ($i) |
| Returns the nth parameter in the request.
|
|
| kindOf () |
| Kept the old name even if Request class was renamed, for BC.
|
|
| method ($methodName='') |
| Gets/sets the xml-rpc method to be invoked.
|
|
| parseResponse ($data='', $headersProcessed=false, $returnType=XMLParser::RETURN_XMLRPCVALS) |
| Parse the xml-rpc response contained in the string $data and return a Response object.
|
|
| parseResponseFile ($fp, $headersProcessed=false, $returnType='xmlrpcvals') |
| Given an open file handle, read all data available and parse it as an xml-rpc response.
|
|
| serialize ($charsetEncoding='') |
| Returns xml representation of the message, XML prologue included.
|
|
| setDebug ($level) |
| Enables/disables the echoing to screen of the xml-rpc responses received.
|
|
| xml_footer () |
|
| xml_header ($charsetEncoding='') |
|
|
int | $debug = 0 |
|
string | $methodname |
|
Value[] | $params = array() |
|
◆ __construct()
PhpXmlRpc\Request::__construct |
( |
| $methodName, |
|
|
| $params = array() ) |
- Parameters
-
string | $methodName | the name of the method to invoke |
Value[] | $params | array of parameters to be passed to the method (NB: Value objects, not plain php values) |
◆ addParam()
PhpXmlRpc\Request::addParam |
( |
| $param | ) |
|
Add a parameter to the list of parameters to be used upon method invocation.
Checks that $params is actually a Value object and not a plain php value.
- Parameters
-
- Return values
-
◆ getNumParams()
PhpXmlRpc\Request::getNumParams |
( |
| ) |
|
Returns the number of parameters in the message.
- Return values
-
integer | the number of parameters currently set |
◆ getParam()
PhpXmlRpc\Request::getParam |
( |
| $i | ) |
|
Returns the nth parameter in the request.
The index zero-based.
- Parameters
-
integer | $i | the index of the parameter to fetch (zero based) |
- Return values
-
◆ kindOf()
PhpXmlRpc\Request::kindOf |
( |
| ) |
|
Kept the old name even if Request class was renamed, for BC.
- Return values
-
◆ method()
PhpXmlRpc\Request::method |
( |
| $methodName = '' | ) |
|
Gets/sets the xml-rpc method to be invoked.
- Parameters
-
string | $methodName | the method to be set (leave empty not to set it) |
- Return values
-
string | the method that will be invoked |
◆ parseResponse()
PhpXmlRpc\Request::parseResponse |
( |
| $data = '', |
|
|
| $headersProcessed = false, |
|
|
| $returnType = XMLParser::RETURN_XMLRPCVALS ) |
Parse the xml-rpc response contained in the string $data and return a Response object.
When $this->debug has been set to a value greater than 0, will echo debug messages to screen while decoding.
- Parameters
-
string | $data | the xml-rpc response, possibly including http headers |
bool | $headersProcessed | when true prevents parsing HTTP headers for interpretation of content-encoding and consequent decoding |
string | $returnType | decides return type, i.e. content of response->value(). Either 'xmlrpcvals', 'xml' or 'phpvals' |
- Return values
-
- Todo
parsing Responses is not really the responsibility of the Request class. Maybe of the Client...
what about only populating 'raw_data' in httpResponse when debug mode is > 0?
feature creep - allow parsing data gotten from a stream pointer instead of a string: read it piecewise, looking first for separation between headers and body, then for charset indicators, server debug info and </methodResponse>. That would require a notable increase in code complexity...
◆ parseResponseFile()
PhpXmlRpc\Request::parseResponseFile |
( |
| $fp, |
|
|
| $headersProcessed = false, |
|
|
| $returnType = 'xmlrpcvals' ) |
Given an open file handle, read all data available and parse it as an xml-rpc response.
NB: the file handle is not closed by this function. NNB: might have trouble in rare cases to work on network streams, as we check for a read of 0 bytes instead of feof($fp). But since checking for feof(null) returns false, we would risk an infinite loop in that case, because we cannot trust the caller to give us a valid pointer to an open file...
- Parameters
-
resource | $fp | stream pointer |
bool | $headersProcessed | |
string | $returnType | |
- Return values
-
- Todo
arsing Responses is not really the responsibility of the Request class. Maybe of the Client...
feature creep - add a flag to disable trying to parse the http headers
◆ serialize()
PhpXmlRpc\Request::serialize |
( |
| $charsetEncoding = '' | ) |
|
Returns xml representation of the message, XML prologue included.
Sets payload
and content_type
properties
- Parameters
-
- Return values
-
string | the xml representation of the message, xml prologue included |
◆ setDebug()
PhpXmlRpc\Request::setDebug |
( |
| $level | ) |
|
Enables/disables the echoing to screen of the xml-rpc responses received.
- Parameters
-
integer | $level | values <0, 0, 1, >1 are supported |
- Return values
-
The documentation for this class was generated from the following file:
- lib/phpxmlrpc/Request.php