yocto/yoclib-epp

此yoc库使您的项目能够在PHP中通过EPP(可扩展配置协议)发送和接收数据。

dev-master 2024-08-30 22:22 UTC

This package is auto-updated.

Last update: 2024-08-30 22:22:42 UTC


README

此yoc库使您的项目能够在PHP中通过EPP(可扩展配置协议)发送和接收数据。

状态

PHP Composer codecov

安装

composer require yocto/yoclib-epp

使用

读取

use YOCLIB\EPP\EPPDocumentHelper;
use YOCLIB\EPP\Connections\EPPTCPConnection;
use YOCLIB\EPP\Elements\EPPEppElement;

$conn = new EPPTCPConnection(new SIDNTest);

$doc = $conn->readDocument();

/**@var EPPEppElement $epp*/
$epp = $doc->documentElement;

$hello = $epp->getHello();

写入

use YOCLIB\EPP\EPPDocumentHelper;
use YOCLIB\EPP\EPPNamespaces;
use YOCLIB\EPP\Connections\EPPTCPConnection;
use YOCLIB\EPP\Registries\SIDNTest;

$doc = EPPDocumentHelper::createEPPDocument();

$epp = $doc->createElementNS(EPPNamespaces::EPP_1_0,'epp');

$hello = $doc->createElementNS(EPPNamespaces::EPP_1_0,'hello');

$epp->appendChild($hello);

$doc->appendChild($epp);

$conn = new EPPTCPConnection(new SIDNTest);

$xml = $conn->writeDocument($doc);