ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
XML_RPC2_Backend_Php_Request Class Reference
+ Collaboration diagram for XML_RPC2_Backend_Php_Request:

Public Member Functions

 setParameters ($value)
 parameters property setter
 addParameter ($value)
 parameters property appender
 getParameters ()
 parameters property getter
 getMethodName ()
 method name getter
 __construct ($methodName, $encoding= 'iso-8859-1')
 Create a new xml-rpc request with the provided methodname.
 encode ()
 Encode the request for transmission.

Static Public Member Functions

static createFromDecode ($simpleXML)
 Decode a request from XML and construct a request object with the createFromDecoded values.

Private Attributes

 $_methodName = ''
 $_parameters = null
 $_encoding = 'iso-8859-1'

Detailed Description

Definition at line 58 of file Request.php.

Constructor & Destructor Documentation

XML_RPC2_Backend_Php_Request::__construct (   $methodName,
  $encoding = 'iso-8859-1' 
)

Create a new xml-rpc request with the provided methodname.

Parameters
stringName of method targeted by this xml-rpc request
stringencoding of the request

Definition at line 144 of file Request.php.

References setParameters().

{
$this->_methodName = $methodName;
$this->setParameters(array());
$this->_encoding = $encoding;
}

+ Here is the call graph for this function:

Member Function Documentation

XML_RPC2_Backend_Php_Request::addParameter (   $value)

parameters property appender

Parameters
mixedvalue The new parameter

Definition at line 104 of file Request.php.

{
$this->_parameters[] = $value;
}
static XML_RPC2_Backend_Php_Request::createFromDecode (   $simpleXML)
static

Decode a request from XML and construct a request object with the createFromDecoded values.

Parameters
SimpleXMLElementThe encoded XML-RPC request.
Returns
XML_RPC2_Backend_Php_Request The xml-rpc request, represented as an object instance

Definition at line 187 of file Request.php.

Referenced by XML_RPC2_Backend_Php_Server\getResponse().

{
$methodName = (string) $simpleXML->methodName;
$params = array();
foreach ($simpleXML->params->param as $param) {
foreach ($param->value as $value) {
$params[] = XML_RPC2_Backend_Php_Value::createFromDecode($value)->getNativeValue();
}
}
$result = new XML_RPC2_Backend_Php_Request($methodName);
$result->setParameters($params);
return $result;
}

+ Here is the caller graph for this function:

XML_RPC2_Backend_Php_Request::encode ( )

Encode the request for transmission.

Returns
string XML-encoded request (a full XML document)

Definition at line 159 of file Request.php.

References $_methodName, XML_RPC2_Backend_Php_Value\createFromNative(), and getParameters().

{
$methodName = $this->_methodName;
$parameters = $this->getParameters();
$result = '<?xml version="1.0" encoding="' . $this->_encoding . '"?>';
$result .= '<methodCall>';
$result .= "<methodName>${methodName}</methodName>";
$result .= '<params>';
foreach($parameters as $parameter) {
$result .= '<param><value>';
$result .= ($parameter instanceof XML_RPC2_Backend_Php_Value) ? $parameter->encode() : XML_RPC2_Backend_Php_Value::createFromNative($parameter)->encode();
$result .= '</value></param>';
}
$result .= '</params>';
$result .= '</methodCall>';
return $result;
}

+ Here is the call graph for this function:

XML_RPC2_Backend_Php_Request::getMethodName ( )

method name getter

Returns
string method name

Definition at line 130 of file Request.php.

References $_methodName.

{
}
XML_RPC2_Backend_Php_Request::getParameters ( )

parameters property getter

Returns
mixed The current parameters

Definition at line 117 of file Request.php.

References $_parameters.

Referenced by encode().

{
}

+ Here is the caller graph for this function:

XML_RPC2_Backend_Php_Request::setParameters (   $value)

parameters property setter

Parameters
mixedvalue The new parameters

Definition at line 91 of file Request.php.

Referenced by __construct().

{
$this->_parameters = $value;
}

+ Here is the caller graph for this function:

Field Documentation

XML_RPC2_Backend_Php_Request::$_encoding = 'iso-8859-1'
private

Definition at line 81 of file Request.php.

XML_RPC2_Backend_Php_Request::$_methodName = ''
private

Definition at line 67 of file Request.php.

Referenced by encode(), and getMethodName().

XML_RPC2_Backend_Php_Request::$_parameters = null
private

Definition at line 74 of file Request.php.

Referenced by getParameters().


The documentation for this class was generated from the following file: