antanasga/xmlrpcdecode

解码 XMLRPC 请求的简单方式

v0.1.4 2021-08-02 06:34 UTC

This package is auto-updated.

Last update: 2024-09-29 06:03:05 UTC


README

解码 XMLRPC 请求的简单方式

文档

安装

使用 composer 安装

composer.json:

"require": {
    "antanasga/xmlrpcdecode": "^0.1.4"
}

在终端

$ composer require antanasga/xmlrpcdecode

用法

通过 Decode 类的接口。

__construct - 接受有效的 XML 字符串的字符串值,如果需要抛出错误或故障代码,可以传递布尔值

fetch - 方法返回值数组

errorInfo - 方法返回包含 faultCodefaultString 值的 ResponseError 对象

// ...
$e = new Decode($validXMLString);

var_dump($e->fetch());

if ($e->errorInfo() !== null) {
    die(); // your error handling
}