XMLRPC

属性
命名空间 fize\xml
类名 XmlRpc
方法:
方法名 说明
decodeRequest() 将 XML 译码为 PHP 本身的类型
decode() 将 XML 译码为 PHP 本身的类型
encodeRequest() 为 PHP 的值生成 XML
encode() 为 PHP 的值生成 XML
getType() 为 PHP 的值获取 xmlrpc 的类型
isFault() 确定数组的值代表一个 XMLRPC 故障
parseMethodDescriptions() 将 XML 译码成方法描述的列表
addIntrospectionData() 添加自我描述的文档
callMethod() 解析 XML 请求同时调用方法
create() 创建一个 xmlrpc 服务端
destroy() 销毁服务端资源
registerIntrospectionCallback() 注册一个 PHP 函数用于生成文档
registerMethod() 注册一个 PHP 函数用于匹配 xmlrpc 方法名
setType() 为一个 PHP 字符串值设置 xmlrpc 的类型、base64 或日期时间

方法

decodeRequest()

将 XML 译码为 PHP 本身的类型

public static function decodeRequest (
    string $xml,
    string &$method,
    string $encoding = null
) : mixed
参数:
名称 说明
xml XMLRPC请求体
method 返回方法名
encoding 指定编码
返回值:

返回参数列表

decode()

将 XML 译码为 PHP 本身的类型

public static function decode (
    string $xml,
    string $encoding = "iso-8859-1"
) : mixed
参数:
名称 说明
xml 待译码XML
encoding 指定编码

encodeRequest()

为 PHP 的值生成 XML

public static function encodeRequest (
    string $method,
    mixed $params,
    array $output_options = []
) : string
参数:
名称 说明
method 方法名称
params 参数
output_options 输出选项
返回值:

完整XML

encode()

为 PHP 的值生成 XML

public static function encode (
    mixed $value
) : string
参数:
名称 说明
value
返回值:

完整XML

getType()

为 PHP 的值获取 xmlrpc 的类型

public static function getType (
    mixed $value
) : string
参数:
名称 说明
value
返回值:

值类型

isFault()

确定数组的值代表一个 XMLRPC 故障

public static function isFault (
    array $arg
) : bool
参数:
名称 说明
arg  

parseMethodDescriptions()

将 XML 译码成方法描述的列表

public static function parseMethodDescriptions (
     $xml
) : array
参数:
名称 说明
xml  

addIntrospectionData()

添加自我描述的文档

public function addIntrospectionData (
    array $desc
) : int
参数:
名称 说明
desc  

callMethod()

解析 XML 请求同时调用方法

public function callMethod (
     $xml,
     $user_data,
    array $output_options = []
) : string
参数:
名称 说明
xml  
user_data  
output_options  

create()

创建一个 xmlrpc 服务端

public function create () : resource

destroy()

销毁服务端资源

public function destroy () : bool

registerIntrospectionCallback()

注册一个 PHP 函数用于生成文档

public function registerIntrospectionCallback (
    string $function
) : bool
参数:
名称 说明
function  

registerMethod()

注册一个 PHP 函数用于匹配 xmlrpc 方法名

public function registerMethod (
    string $method_name,
    string $function
) : bool
参数:
名称 说明
method_name  
function  

setType()

为一个 PHP 字符串值设置 xmlrpc 的类型、base64 或日期时间

public static function setType (
    mixed &$value,
    string $type
) : bool
参数:
名称 说明
value  
type