* Name of compression scheme to be used for sending requests.
* Either null, gzip or deflate.
*/
-
public $request_compression = '';
/**
* CURL handle: used for keep-alive connections (PHP 4.3.8 up, see:
* http://curl.haxx.se/docs/faq.html#7.3).
+ * @internal
*/
public $xmlrpc_curl_handle = null;
/**
* A helper class to easily convert between Value objects and php native values
* @todo implement an interface
+ * @todo add class constants for the options values
*/
class Encoder
{
* This means that the remote communication end can decide which php code will get executed on your server, leaving
* the door possibly open to 'php-injection' style of attacks (provided you have some classes defined on your server
* that might wreak havoc if instances are built outside an appropriate context).
- * Make sure you trust the remote server/client before eanbling this!
+ * Make sure you trust the remote server/client before enabling this!
*
* @author Dan Libby (dan@libby.com)
*
// What if internal encoding is not in one of the 3 allowed? We use the broadest one, ie. utf8!
if (!in_array(PhpXmlRpc::$xmlrpc_internalencoding, array('UTF-8', 'ISO-8859-1', 'US-ASCII'))) {
- $options = array(XML_OPTION_TARGET_ENCODING => 'UTF-8');
+ $parserOptions = array(XML_OPTION_TARGET_ENCODING => 'UTF-8');
} else {
- $options = array(XML_OPTION_TARGET_ENCODING => PhpXmlRpc::$xmlrpc_internalencoding);
+ $parserOptions = array(XML_OPTION_TARGET_ENCODING => PhpXmlRpc::$xmlrpc_internalencoding);
}
- $xmlRpcParser = new XMLParser($options);
+ $xmlRpcParser = new XMLParser($parserOptions);
$xmlRpcParser->parse($xmlVal, XMLParser::RETURN_XMLRPCVALS, XMLParser::ACCEPT_REQUEST | XMLParser::ACCEPT_RESPONSE | XMLParser::ACCEPT_VALUE | XMLParser::ACCEPT_FAULT);
if ($xmlRpcParser->_xh['isf'] > 1) {
return false;
}
}
-
}
namespace PhpXmlRpc\Helper;
+/**
+ * @todo make constructor private to force users to go through `instance`
+ */
class Logger
{
protected static $instance = null;
/**
* xml parser handler function for opening element tags.
+ * @internal
* @param resource $parser
* @param string $name
* @param $attrs
/**
* xml parser handler function for close element tags.
+ * @internal
* @param resource $parser
* @param string $name
* @param int $rebuildXmlrpcvals >1 for rebuilding xmlrpcvals, 0 for rebuilding php values, -1 for xmlrpc-extension compatibility
/**
* Used in decoding xmlrpc requests/responses without rebuilding xmlrpc Values.
+ * @internal
* @param resource $parser
* @param string $name
*/
/**
* Used in decoding xmlrpc requests/responses while building xmlrpc-extension Values (plain php for all but base64 and datetime).
+ * @internal
* @param resource $parser
* @param string $name
*/
/**
* xml parser handler function for character data.
+ * @internal
* @param resource $parser
* @param string $data
*/
/**
* xml parser handler function for 'other stuff', ie. not char data or
* element start/end tag. In fact it only gets called on unknown entities...
+ * @internal
* @param $parser
* @param string data
*/
{
/// @todo: do these need to be public?
public $payload;
+ /** @internal */
public $methodname;
+ /** @internal */
public $params = array();
public $debug = 0;
public $content_type = 'text/xml';
}
}
+ /**
+ * @internal this function will become protected in the future
+ * @param string $charsetEncoding
+ * @return string
+ */
public function xml_header($charsetEncoding = '')
{
if ($charsetEncoding != '') {
}
}
+ /**
+ * @internal this function will become protected in the future
+ * @return string
+ */
public function xml_footer()
{
return '</methodCall>';
}
+ /**
+ * @internal this function will become protected in the future
+ * @param string $charsetEncoding
+ */
public function createPayload($charsetEncoding = '')
{
if ($charsetEncoding != '') {
* 'phpvals'
*
* @return Response
+ *
+ * @todo parsing Responses is not really the responsibility of the Request class. Maybe of the Client...
*/
public function parseResponse($data = '', $headersProcessed = false, $returnType = 'xmlrpcvals')
{
}
}
- // if user wants back raw xml, give it to him
+ // if user wants back raw xml, give it to her
if ($returnType == 'xml') {
$r = new Response($data, 0, '', 'xml');
$r->hdrs = $this->httpResponse['headers'];
class Response
{
/// @todo: do these need to be public?
+ /** @internal */
public $val = 0;
+ /** @internal */
public $valtyp;
+ /** @internal */
public $errno = 0;
+ /** @internal */
public $errstr = '';
public $payload;
+ public $content_type = 'text/xml';
public $hdrs = array();
public $_cookies = array();
- public $content_type = 'text/xml';
public $raw_data = '';
/**
namespace PhpXmlRpc;
-use PhpXmlRpc\Helper\Logger;
use PhpXmlRpc\Helper\Charset;
+use PhpXmlRpc\Helper\Logger;
use PhpXmlRpc\Helper\XMLParser;
/**
* Defines how functions in dmap will be invoked: either using an xmlrpc request object
* or plain php values.
* Valid strings are 'xmlrpcvals', 'phpvals' or 'epivals'
+ * @todo create class constants for these
*/
public $functions_parameters_type = 'xmlrpcvals';
/// @todo: do these need to be public?
/** @var Value[]|mixed */
public $me = array();
- /** @var int $mytype */
+ /**
+ * @var int $mytype
+ * @internal
+ */
public $mytype = 0;
/** @var string|null $_php_class */
public $_php_class = null;
}
}
+ /**
+ * @internal required to be public to implement an Interface
+ * @param mixed $offset
+ * @param mixed $value
+ * @throws \Exception
+ */
public function offsetSet($offset, $value)
{
switch ($this->mytype) {
}
}
+ /**
+ * @internal required to be public to implement an Interface
+ * @param mixed $offset
+ * @return bool
+ */
public function offsetExists($offset)
{
switch ($this->mytype) {
}
}
+ /**
+ * @internal required to be public to implement an Interface
+ * @param mixed $offset
+ * @throws \Exception
+ */
public function offsetUnset($offset)
{
switch ($this->mytype) {
}
}
+ /**
+ * @internal required to be public to implement an Interface
+ * @param mixed $offset
+ * @return mixed|Value|null
+ * @throws \Exception
+ */
public function offsetGet($offset)
{
switch ($this->mytype) {