public $cookies = array();
public $extracurlopts = array();
+
+ /**
+ * @var int
+ */
public $use_curl = self::USE_CURL_AUTO;
/**
public $no_multicall = false;
/**
+ * @var array
+ *
* List of http compression methods accepted by the client for responses.
* NB: PHP supports deflate, gzip compressions out of the box if compiled w. zlib.
*
public $accepted_compression = array();
/**
+ * @var string|null
+ *
* Name of compression scheme to be used for sending requests.
- * Either null, gzip or deflate.
+ * Either null, 'gzip' or 'deflate'.
*/
public $request_compression = '';
*/
public $xmlrpc_curl_handle = null;
- /// Whether to use persistent connections for http 1.1 and https
+ /**
+ * @var bool
+ *
+ * Whether to use persistent connections for http 1.1 and https.
+ */
public $keepalive = false;
- /// Charset encodings that can be decoded without problems by the client
+ /**
+ * @var string[]
+ *
+ * Charset encodings that can be decoded without problems by the client
+ */
public $accepted_charset_encodings = array();
/**
+ * @var string
+ *
* The charset encoding that will be used for serializing request sent by the client.
* It defaults to NULL, which means using US-ASCII and encoding all characters outside the ASCII printable range
* using their xml character entity representation (this has the benefit that line end characters will not be mangled
public $request_charset_encoding = '';
/**
+ * @var string
+ *
* Decides the content of Response objects returned by calls to send() and multicall().
* Valid values are 'xmlrpcvals', 'phpvals' or 'xml'.
*
public $return_type = XMLParser::RETURN_XMLRPCVALS;
/**
+ * @var string
+ *
* Sent to servers in http headers.
*/
public $user_agent;
return self::$logger;
}
+ /**
+ * @param $logger
+ * @return void
+ */
public static function setLogger($logger)
{
self::$logger = $logger;
* the server returns. Never leave it enabled for production!
*
* @param integer $level values 0, 1 and 2 are supported (2 = echo sent msg too, before received response)
+ * @return void
*/
public function setDebug($level)
{
* @param integer $authType auth type. See curl_setopt man page for supported auth types. Defaults to CURLAUTH_BASIC
* (basic auth). Note that auth types NTLM and Digest will only work if the Curl php
* extension is enabled.
+ * @return void
*/
public function setCredentials($user, $password, $authType = 1)
{
*
* @param string $cert the name of a file containing a PEM formatted certificate
* @param string $certPass the password required to use it
+ * @return void
*/
public function setCertificate($cert, $certPass = '')
{
*
* @param string $caCert certificate file name (or dir holding certificates)
* @param bool $isDir set to true to indicate cacert is a dir. defaults to false
+ * @return void
*/
public function setCaCertificate($caCert, $isDir = false)
{
*
* @param string $key The name of a file containing a private SSL key
* @param string $keyPass The secret password needed to use the private SSL key
+ * @return void
*/
public function setKey($key, $keyPass)
{
* To specify custom SSL certificates to validate the server with, use the setCaCertificate method.
*
* @param bool $i enable/disable verification of peer certificate
+ * @return void
*/
public function setSSLVerifyPeer($i)
{
* Note that support for value 1 has been removed in cURL 7.28.1
*
* @param int $i Set to 1 to only the existence of a CN, not that it matches
+ * @return void
*/
public function setSSLVerifyHost($i)
{
* Set attributes for SSL communication: SSL version to use. Best left at 0 (default value): let cURL decide
*
* @param int $i
+ * @return void
*/
public function setSSLVersion($i)
{
* @param string $proxyPassword Leave blank if proxy has public access
* @param int $proxyAuthType defaults to CURLAUTH_BASIC (Basic authentication protocol); set to constant CURLAUTH_NTLM
* to use NTLM auth with proxy (has effect only when the client uses the HTTP 1.1 protocol)
+ * @return void
*/
public function setProxy($proxyHost, $proxyPort, $proxyUsername = '', $proxyPassword = '', $proxyAuthType = 1)
{
* It is up to the xmlrpc server to return compressed responses when receiving such requests.
*
* @param string $compMethod either 'gzip', 'deflate', 'any' or ''
+ * @return void
*/
public function setAcceptedCompression($compMethod)
{
* uncompressed requests is not yet implemented).
*
* @param string $compMethod either 'gzip', 'deflate' or ''
+ * @return void
*/
public function setRequestCompression($compMethod)
{
* @param string $path leave this empty unless the xml-rpc server only accepts RFC 2109 cookies
* @param string $domain leave this empty unless the xml-rpc server only accepts RFC 2109 cookies
* @param int $port leave this empty unless the xml-rpc server only accepts RFC 2109 cookies
+ * @return void
*
* @todo check correctness of urlencoding cookie value (copied from php way of doing it, but php is generally sending
* response not requests. We do the opposite...)
* It allows eg. to bind client to a specific IP interface / address.
*
* @param array $options
+ * @return void
*/
public function setCurlOptions($options)
{
/**
* @param int $useCurlMode self::USE_CURL_ALWAYS, self::USE_CURL_AUTO or self::USE_CURL_NEVER
+ * @return void
*/
public function setUseCurl($useCurlMode)
{
* The default user agent string includes the name of this library and the version number.
*
* @param string $agentString
+ * @return void
*/
public function setUserAgent($agentString)
{
* for http/2 without tls. Note that 'h2c' will not use the h2c 'upgrade' method, and be
* thus incompatible with any server/proxy not supporting http/2. This is because POST
* request are not compatible with h2c upgrade.
- *
* @return Response|Response[] Note that the client will always return a Response object, even if the call fails
*
* @todo allow throwing exceptions instead of returning responses in case of failed calls and/or Fault responses
* @param string $proxyPassword
* @param int $proxyAuthType
* @param string $method
- *
* @return Response
*/
protected function sendPayloadHTTP10($req, $server, $port, $timeout = 0, $username = '', $password = '',
* @param string $key
* @param string $keyPass
* @param int $sslVersion
- *
* @return Response
*/
protected function sendPayloadHTTPS($req, $server, $port, $timeout = 0, $username = '', $password = '',
* @param string $key
* @param string $keyPass @todo not implemented yet.
* @param int $sslVersion @todo not implemented yet. See http://php.net/manual/en/migration56.openssl.php
- *
* @return Response
*
* @todo refactor: we get many options for the call passed in, but some we use from $this. We should clean that up
* @param string $key
* @param string $keyPass
* @param int $sslVersion
- *
* @return Response
*
* @todo refactor: we get many options for the call passed in, but some we use from $this. We should clean that up
* @param string $method the http protocol variant to be used. See the details in the docs for the send() method
* @param boolean $fallback When true, upon receiving an error during multicall, multiple single calls will be
* attempted
- *
* @return Response[]
*/
public function multicall($reqs, $timeout = 0, $method = '', $fallback = true)
* @param Request[] $reqs
* @param int $timeout
* @param string $method
- *
* @return Response[]|string|false|Response string when return_type=xml, a single Response when the call returned a
* fault, false when the returned response does not conform to what we expect
* from a multicall response
return self::$logger;
}
+ /**
+ * @param $logger
+ * @return void
+ */
public static function setLogger($logger)
{
self::$logger = $logger;
return self::$parser;
}
+ /**
+ * @param $parser
+ * @return void
+ */
public static function setParser($parser)
{
self::$parser = $parser;
* objects, see the details above;
* - 'dates_as_objects': when set xmlrpc dateTimes are decoded as php DateTime objects
* - 'extension_api': reserved for usage by phpxmlrpc-polyfill
- *
* @return mixed
*
* Feature creep -- add an option to allow converting xmlrpc dateTime values to unix timestamps (integers)
* - 'auto_dates': when set, any string which respects the xmlrpc datetime format will be converted to a dateTime Value
* - 'null_extension': when set, php NULL values will be converted to an xmlrpc <NIL> (or <EX:NIL>) Value
* - 'extension_api': reserved for usage by phpxmlrpc-polyfill
- *
* @return Value
*
* Feature creep -- could support more types via optional type argument (string => datetime support has been added,
*
* @param string $xmlVal
* @param array $options
- *
* @return Value|Request|Response|false false on error, or an instance of either Value, Request or Response
*
* @todo is this a good name/class for this method? It does something quite different from 'decode' after all
/**
* @param string $tableName
+ * @return void
*
* @throws \Exception for unsupported $tableName
*
* @param string $data
* @param string $srcEncoding
* @param string $destEncoding
- *
* @return string
*
* @todo do a bit of basic benchmarking (strtr vs. str_replace)
*
* @param string $encoding charset to be tested
* @param string|array $validList comma separated list of valid charsets (or array of charsets)
- *
* @return bool
*/
public function isValidCharset($encoding, $validList)
* @deprecated
*
* @param string $charset
- *
* @return array
* @throws \Exception for unknown/unsupported charsets
*/
* adjustment for the local timezone's offset is made
*
* @param int $timet (timestamp)
- * @param int $utc (0 or 1)
- *
+ * @param bool|int $utc (0 or 1)
* @return string
*/
public static function iso8601Encode($timet, $utc = 0)
* Given an ISO8601 date string, return a timestamp in the localtime, or UTC.
*
* @param string $idate
- * @param int $utc either 0 (assume date is in local time) or 1 (assume date is in UTC)
+ * @param bool|int $utc either 0 (assume date is in local time) or 1 (assume date is in UTC)
*
* @return int (timestamp) 0 if the source string does not match the xmlrpc dateTime format
*/
* @internal this function will become protected in the future
*
* @param string $buffer the string to be decoded
- *
* @return string
*/
public static function decodeChunked($buffer)
* @param string $data the http response, headers and body. It will be stripped of headers
* @param bool $headersProcessed when true, we assume that response inflating and dechunking has been already carried out
* @param int $debug when != 0, logs to screen messages detailing info about the parsed data
- *
* @return array with keys 'headers', 'cookies', 'raw_data' and 'status_code'
* @throws HttpException
*
*
* @param string $message
* @param string $encoding
+ * @return void
*/
public function debugMessage($message, $encoding = null)
{
/**
* Writes a message to the error log.
* @param string $message
+ * @return void
*/
public function errorLog($message)
{
* @param string $returnType
* @param int $accept a bit-combination of self::ACCEPT_REQUEST, self::ACCEPT_RESPONSE, self::ACCEPT_VALUE
* @param array $options passed to the xml parser, in addition to the options received in the constructor
+ * @return void
*/
public function parse($data, $returnType = self::RETURN_XMLRPCVALS, $accept = 3, $options = array())
{
* @param string $name
* @param $attrs
* @param bool $acceptSingleVals DEPRECATED use the $accept parameter instead
+ * @return void
*/
public function xmlrpc_se($parser, $name, $attrs, $acceptSingleVals = false)
{
* @param resource $parser
* @param $name
* @param $attrs
+ * @return void
*/
public function xmlrpc_se_any($parser, $name, $attrs)
{
* @param resource $parser
* @param string $name
* @param int $rebuildXmlrpcvals >1 for rebuilding xmlrpcvals, 0 for rebuilding php values, -1 for xmlrpc-extension compatibility
+ * @return void
*/
public function xmlrpc_ee($parser, $name, $rebuildXmlrpcvals = 1)
{
*
* @param resource $parser
* @param string $name
+ * @return void
*/
public function xmlrpc_ee_fast($parser, $name)
{
*
* @param resource $parser
* @param string $name
+ * @return void
*/
public function xmlrpc_ee_epi($parser, $name)
{
*
* @param resource $parser
* @param string $data
+ * @return void
*/
public function xmlrpc_cd($parser, $data)
{
*
* @param $parser
* @param string data
+ * @return void
*/
public function xmlrpc_dh($parser, $data)
{
* Helper function: checks if an xml chunk has a charset declaration (BOM or in the xml declaration).
*
* @param string $xmlChunk
- *
* @return bool
*/
public static function hasEncoding($xmlChunk)
*/
class PhpXmlRpc
{
+ /**
+ * @var int[]
+ */
static public $xmlrpcerr = array(
'unknown_method' => 1,
/// @deprecated. left in for BC
'server_decompress_fail' => 107,
);
+ /**
+ * @var string[]
+ */
static public $xmlrpcstr = array(
'unknown_method' => 'Unknown method',
/// @deprecated. left in for BC
'server_decompress_fail' => 'Received from client invalid compressed HTTP request',
);
- // The charset encoding used by the server for received requests and by the client for received responses when
- // received charset cannot be determined and mbstring extension is not enabled
+ /**
+ * @var string
+ * The charset encoding used by the server for received requests and by the client for received responses when
+ * received charset cannot be determined and mbstring extension is not enabled.
+ */
public static $xmlrpc_defencoding = "UTF-8";
- // The list of encodings used by the server for requests and by the client for responses to detect the charset of
- // the received payload when
- // - the charset cannot be determined by looking at http headers, xml declaration or BOM
- // - mbstring extension is enabled
+ /**
+ * @var string[]
+ * The list of encodings used by the server for requests and by the client for responses to detect the charset of
+ * the received payload when
+ * - the charset cannot be determined by looking at http headers, xml declaration or BOM
+ * - mbstring extension is enabled
+ */
public static $xmlrpc_detectencodings = array();
- // The encoding used internally by PHP.
- // String values received as xml will be converted to this, and php strings will be converted to xml as if
- // having been coded with this.
- // Valid also when defining names of xmlrpc methods
+ /**
+ * @var string
+ * The encoding used internally by PHP.
+ * String values received as xml will be converted to this, and php strings will be converted to xml as if
+ * having been coded with this.
+ * Valid also when defining names of xmlrpc methods
+ */
public static $xmlrpc_internalencoding = "UTF-8";
+ /**
+ * @var string
+ */
public static $xmlrpcName = "XML-RPC for PHP";
+ /**
+ * @var string
+ */
public static $xmlrpcVersion = "4.9.3";
- // let user errors start at 800
+ /**
+ * @var int
+ * Let user errors start at 800
+ */
public static $xmlrpcerruser = 800;
- // let XML parse errors start at 100
+ /**
+ * @var int
+ * Let XML parse errors start at 100
+ */
public static $xmlrpcerrxml = 100;
- // set to TRUE to enable correct decoding of <NIL/> and <EX:NIL/> values
+ /**
+ * @var bool
+ * Set to TRUE to enable correct decoding of <NIL/> and <EX:NIL/> values
+ */
public static $xmlrpc_null_extension = false;
- // set to TRUE to enable encoding of php NULL values to <EX:NIL/> instead of <NIL/>
+ /**
+ * @var bool
+ * Set to TRUE to enable encoding of php NULL values to <EX:NIL/> instead of <NIL/>
+ */
public static $xmlrpc_null_apache_encoding = false;
public static $xmlrpc_null_apache_encoding_ns = "http://ws.apache.org/xmlrpc/namespaces/extensions";
- // number of decimal digits used to serialize Double values
+ /**
+ * @var int
+ * Number of decimal digits used to serialize Double values.
+ */
public static $xmlpc_double_precision = 128;
/**
* A function to be used for compatibility with legacy code: it creates all global variables which used to be declared,
* such as library version etc...
+ * @return void
*/
public static function exportGlobals()
{
* 2. set the values, e.g. $GLOBALS['xmlrpc_internalencoding'] = 'UTF-8';
* 3. import them: PhpXmlRpc\PhpXmlRpc::importGlobals();
* 4. run your own code.
+ *
+ * @return void
*/
public static function importGlobals()
{
return self::$logger;
}
+ /**
+ * @param $logger
+ * @return void
+ */
public static function setLogger($logger)
{
self::$logger = $logger;
return self::$parser;
}
+ /**
+ * @param $parser
+ * @return void
+ */
public static function setParser($parser)
{
self::$parser = $parser;
return self::$charsetEncoder;
}
- /// @todo this should be a static method
+ /**
+ * @param $charsetEncoder
+ * @return void
+ *
+ * @todo this should be a static method
+ */
public function setCharsetEncoder($charsetEncoder)
{
self::$charsetEncoder = $charsetEncoder;
* @internal this function will become protected in the future
*
* @param string $charsetEncoding
- *
* @return string
*/
public function xml_header($charsetEncoding = '')
* @internal this function will become protected in the future
*
* @param string $charsetEncoding
+ * @return void
*/
public function createPayload($charsetEncoding = '')
{
* Gets/sets the xmlrpc method to be invoked.
*
* @param string $methodName the method to be set (leave empty not to set it)
- *
* @return string the method that will be invoked
*/
public function method($methodName = '')
* Returns xml representation of the message. XML prologue included.
*
* @param string $charsetEncoding
- *
* @return string the xml representation of the message, xml prologue included
*/
public function serialize($charsetEncoding = '')
* Checks that $params is actually a Value object and not a plain php value.
*
* @param Value $param
- *
* @return boolean false on failure
*/
public function addParam($param)
* Returns the nth parameter in the request. The index zero-based.
*
* @param integer $i the index of the parameter to fetch (zero based)
- *
* @return Value the i-th parameter
*/
public function getParam($i)
* @param resource $fp stream pointer
* @param bool $headersProcessed
* @param string $returnType
- *
* @return Response
*/
public function parseResponseFile($fp, $headersProcessed = false, $returnType = 'xmlrpcvals')
* consequent decoding
* @param string $returnType decides return type, i.e. content of response->value(). Either 'xmlrpcvals', 'xml' or
* 'phpvals'
- *
* @return Response
*
* @todo parsing Responses is not really the responsibility of the Request class. Maybe of the Client...
* Enables/disables the echoing to screen of the xmlrpc responses received.
*
* @param integer $level values 0, 1, 2 are supported
+ * @return void
*/
public function setDebug($level)
{
return self::$charsetEncoder;
}
- /// @todo this should be a static method
+ /**
+ * @param $charsetEncoder
+ * @return void
+ *
+ * @todo this should be a static method
+ */
public function setCharsetEncoder($charsetEncoder)
{
self::$charsetEncoder = $charsetEncoder;
* Returns xml representation of the response. XML prologue not included.
*
* @param string $charsetEncoding the charset to be used for serialization. If null, US-ASCII is assumed
- *
* @return string the xml representation of the response
* @throws \Exception
*/
protected static $charsetEncoder;
/**
+ * @var string
* 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'.
*
public $functions_parameters_type = 'xmlrpcvals';
/**
+ * @var array
* Option used for fine-tuning the encoding the php values returned from functions registered in the dispatch map
* when the functions_parameters_types member is set to 'phpvals'.
* @see Encoder::encode for a list of values
public $phpvals_encoding_options = array('auto_dates');
/**
+ * @var int
* Controls whether the server is going to echo debugging messages back to the client as comments in response body.
* Valid values: 0,1,2,3
*/
public $debug = 1;
/**
+ * @var int
* Controls behaviour of server when the invoked user function throws an exception:
* 0 = catch it and return an 'internal error' xmlrpc response (default)
* 1 = catch it and return an xmlrpc response with the error corresponding to the exception
public $exception_handling = 0;
/**
+ * @var bool
* When set to true, it will enable HTTP compression of the response, in case the client has declared its support
* for compression in the request.
* Set at constructor time.
public $compress_response = false;
/**
+ * @var string[]
* List of http compression methods accepted by the server for requests. Set at constructor time.
* NB: PHP supports deflate, gzip compressions out of the box if compiled w. zlib
*/
public $accepted_compression = array();
/**
+ * @var bool
* Shall we serve calls to system.* methods?
*/
public $allow_system_funcs = true;
public $accepted_charset_encodings = array();
/**
+ * @var string
* Charset encoding to be used for response.
* NB: if we can, we will convert the generated response from internal_encoding to the intended one.
* Can be: a supported xml encoding (only UTF-8 and ISO-8859-1 at present, unless mbstring is enabled),
public $response_charset_encoding = '';
/**
+ * @var mixed
* Extra data passed at runtime to method handling functions. Used only by EPI layer
*/
public $user_data = null;
return self::$logger;
}
+ /**
+ * @param $logger
+ * @return void
+ */
public static function setLogger($logger)
{
self::$logger = $logger;
return self::$parser;
}
+ /**
+ * @param $parser
+ * @return void
+ */
public static function setParser($parser)
{
self::$parser = $parser;
return self::$charsetEncoder;
}
- /// @todo this should be a static method
+ /**
+ * @param $charsetEncoder
+ * @return void
+ *
+ * @todo this should be a static method
+ */
public function setCharsetEncoder($charsetEncoder)
{
self::$charsetEncoder = $charsetEncoder;
* particular, triggering an USER_ERROR level error will not halt script
* execution anymore, but just end up logged in the xmlrpc response)
* Note that info added at level 2 and 3 will be base64 encoded
+ * @return void
*/
public function setDebug($level)
{
* character set.
*
* @param string $msg
+ * @return void
*/
public static function xmlrpc_debugmsg($msg)
{
* (base64 encoded, only when debug level >= 2)
*
* @param string $msg
+ * @return void
*/
public static function error_occurred($msg)
{
* @param string $doc method documentation
* @param array[] $sigDoc the array of valid method signatures docs, following the format of $sig but with
* descriptions instead of types (one string for return type, one per param)
+ * @return void
*
* @todo raise a warning if the user tries to register a 'system.' method
* @todo allow setting parameters_type
*
* @param array|Request $in array of either xmlrpc value objects or xmlrpc type definitions
* @param array $sigs array of known signatures to match against
- *
* @return array int, string
*/
protected function verifySignature($in, $sigs)
*
* @param string $data the xml request
* @param string $reqEncoding (optional) the charset encoding of the xml request
- *
* @return Response
* @throws \Exception in case the executed method does throw an exception (and depending on server configuration)
*
* @param Request|string $req either a Request obj or a method name
* @param mixed[] $params array with method parameters as php types (only if m is method name)
* @param string[] $paramTypes array with xmlrpc types of method parameters (only if m is method name)
- *
* @return Response
*
* @throws \Exception in case the executed method does throw an exception (and depending on server configuration)
* Add a string to the 'internal debug message' (separate from 'user debug message').
*
* @param string $string
+ * @return void
*/
protected function debugmsg($string)
{
/**
* @param string $charsetEncoding
- *
* @return string
*/
protected function xml_header($charsetEncoding = '')
/**
* @param string $methName
- *
* @return bool
*/
protected function isSyscall($methName)
*
* @param Server $server
* @param Request $req
- *
* @return Response
*/
public static function _xmlrpcs_getCapabilities($server, $req = null)
*
* @param Server $server
* @param Request $req if called in plain php values mode, second param is missing
- *
* @return Response
*/
public static function _xmlrpcs_listMethods($server, $req = null)
*
* @param Server $server
* @param Request $req
- *
* @return Response
*/
public static function _xmlrpcs_methodSignature($server, $req)
*
* @param Server $server
* @param Request $req
- *
* @return Response
*/
public static function _xmlrpcs_methodHelp($server, $req)
* @internal this function will become protected in the future
*
* @param $err
- *
* @return Value
*/
public static function _xmlrpcs_multicall_error($err)
*
* @param Server $server
* @param Value $call
- *
* @return Value
*/
public static function _xmlrpcs_multicall_do_call($server, $call)
*
* @param Server $server
* @param Value $call
- *
* @return Value
*/
public static function _xmlrpcs_multicall_do_call_phpvals($server, $call)
*
* @param Server $server
* @param Request|array $req
- *
* @return Response
*/
public static function _xmlrpcs_multicall($server, $req)
/** @var Value[]|mixed */
public $me = array();
/**
- * @var int $mytype
+ * @var int
* @internal
*/
public $mytype = 0;
- /** @var string|null $_php_class */
+ /** @var string|null */
public $_php_class = null;
public function getLogger()
return self::$logger;
}
+ /**
+ * @param $logger
+ * @return void
+ */
public static function setLogger($logger)
{
self::$logger = $logger;
return self::$charsetEncoder;
}
- /// @todo this should be a static method
+ /**
+ * @param $charsetEncoder
+ * @return void
+ *
+ * @todo this should be a static method
+ */
public function setCharsetEncoder($charsetEncoder)
{
self::$charsetEncoder = $charsetEncoder;
*
* @param mixed $val
* @param string $type allowed values: i4, i8, int, boolean, string, double, dateTime.iso8601, base64, null.
- *
* @return int 1 or 0 on failure
*/
public function addScalar($val, $type = 'string')
* Fails otherwise.
*
* @param Value[] $values
- *
* @return int 1 or 0 on failure
*
* @todo add some checking for $values to be an array of xmlrpc values?
* Fails otherwise.
*
* @param Value[] $values
- *
* @return int 1 or 0 on failure
*
* @todo add some checking for $values to be an array?
* @param string $typ
* @param Value[]|mixed $val
* @param string $charsetEncoding
- *
* @return string
*/
protected function serializedata($typ, $val, $charsetEncoding = '')
* Returns the xml representation of the value. XML prologue not included.
*
* @param string $charsetEncoding the charset to be used for serialization. if null, US-ASCII is assumed
- *
* @return string
*/
public function serialize($charsetEncoding = '')
* Works only on xmlrpc values of type struct.
*
* @param string $key the name of the struct member to be looked up
- *
* @return boolean
*
* @deprecated use array access, e.g. isset($val[$key])
* Will raise a php warning if struct member of given name does not exist.
*
* @param string $key the name of the struct member to be looked up
- *
* @return Value
*
* @deprecated use array access, e.g. $val[$key]
/**
* Reset internal pointer for xmlrpc values of type struct.
+ * @return void
+ *
* @deprecated iterate directly over the object using foreach instead
*/
public function structreset()
* @internal required to be public to implement an Interface
*
* @return \ArrayIterator
- *
*/
#[\ReturnTypeWillChange]
public function getIterator()
*
* @param mixed $offset
* @param mixed $value
+ * @return void
*
* @throws \Exception
*/
* @internal required to be public to implement an Interface
*
* @param mixed $offset
- *
* @return bool
*/
#[\ReturnTypeWillChange]
* @internal required to be public to implement an Interface
*
* @param mixed $offset
+ * @return void
*
* @throws \Exception
*/
* @internal required to be public to implement an Interface
*
* @param mixed $offset
- *
* @return mixed|Value|null
* @throws \Exception
*/
return self::$logger;
}
+ /**
+ * @param $logger
+ * @return void
+ */
public static function setLogger($logger)
{
self::$logger = $logger;
* - for 'void' and 'null' returns 'undefined'
*
* @param string $phpType
- *
* @return string
*
* @todo support notation `something[]` as 'array'
* Given a string defining a phpxmlrpc type return the corresponding php type.
*
* @param string $xmlrpcType
- *
* @return string
*/
public function xmlrpc2PhpType($xmlrpcType)
* - bool encode_php_objs let php objects be sent to server using the 'improved' xmlrpc notation, so server can deserialize them as php objects
* - bool decode_php_objs --- WARNING !!! possible security hazard. only use it with trusted servers ---
* - bool suppress_warnings remove from produced xml any warnings generated at runtime by the php function being invoked
- *
* @return array|false false on error, or an array containing the name of the new php function,
* its signature and docs, to be used in the server dispatch map
*
*
* @param callable $callable
* @param string $plainFuncName
- *
* @return array|false
*/
protected function introspectFunction($callable, $plainFuncName)
* Given the method description given by introspection, create method signature data
*
* @param array $funcDesc as generated by self::introspectFunction()
- *
* @return array
*
* @todo support better docs with multiple types separated by pipes by creating multiple signatures
* @param array $extraOptions
* @param string $plainFuncName
* @param array $funcDesc
- *
* @return \Closure
*
* @todo validate params? In theory all validation is left to the dispatch map...
* Return a name for a new function, based on $callable, insuring its uniqueness
* @param mixed $callable a php callable, or the name of an xmlrpc method
* @param string $newFuncName when not empty, it is used instead of the calculated version
- *
* @return string
*/
protected function newFunctionName($callable, $newFuncName, $extraOptions)
* @param array $extraOptions
* @param string $plainFuncName
* @param array $funcDesc
- *
* @return string
*
* @todo add a nice phpdoc block in the generated source
* - string method_filter a regexp used to filter methods to wrap based on their names
* - string prefix used for the names of the xmlrpc methods created.
* - string replace_class_name use to completely replace the class name with the prefix in the generated method names. e.g. instead of \Some\Namespace\Class.method use prefixmethod
- *
* @return array|false false on failure, or on array useable for the dispatch map
*/
public function wrapPhpClass($className, $extraOptions = array())
* @param string|object $className
* @param string $classMethod
* @param array $extraOptions
- *
* @return string
*/
protected function generateMethodNameForClassMethod($className, $classMethod, $extraOptions = array())
* - mixed return_on_fault a php value to be returned when the xmlrpc call fails/returns a fault response (by default the Response object is returned in this case). If a string is used, '%faultCode%' and '%faultString%' tokens will be substituted with actual error values
* - bool debug set it to 1 or 2 to see debug results of querying server for method synopsis
* - int simple_client_copy set it to 1 to have a lightweight copy of the $client object made in the generated code (only used when return_source = true)
- *
* @return \Closure|string[]|false false on failure, closure by default and array for return_source = true
*
* @todo allow the created function to throw exceptions on method calls failures
* @param Client $client
* @param string $methodName
* @param array $extraOptions
- *
* @return false|array
*/
protected function retrieveMethodSignature($client, $methodName, array $extraOptions = array())
* @param Client $client
* @param string $methodName
* @param array $extraOptions
- *
* @return string in case of any error, an empty string is returned, no warnings generated
*/
protected function retrieveMethodHelp($client, $methodName, array $extraOptions = array())
* @param string $methodName
* @param array $extraOptions
* @param array $mSig
- *
* @return \Closure
*
* @todo should we allow usage of parameter simple_client_copy to mean 'do not clone' in this case?
* @param string $newFuncName
* @param array $mSig
* @param string $mDesc
- *
* @return string[] keys: source, docstring
*/
public function buildWrapMethodSource($client, $methodName, array $extraOptions, $newFuncName, $mSig, $mDesc='')
* - string new_class_name
* - string prefix
* - bool simple_client_copy set it to true to avoid copying all properties of $client into the copy made in the new class
- *
* @return string|array|false false on error, the name of the created class if all ok or an array with code, class name and comments (if the appropriate option is set in extra_options)
*
* @todo add support for anonymous classes in the 'buildIt' case for php > 7
* @param bool $verbatimClientCopy when true, copy the whole state of the client, except for 'debug' and 'return_type'
* @param string $prefix used for the return_type of the created client
* @param string $namespace
- *
* @return string
*/
protected function buildClientWrapperCode($client, $verbatimClientCopy, $prefix = 'xmlrpc', $namespace = '\\PhpXmlRpc\\')