xpanel/epp-bundle

一个用于封装EPP连接功能的Symfony Bundle。

安装: 47

依赖: 0

建议: 0

安全性: 0

星标: 0

关注者: 1

分支: 0

开放问题: 0

类型: symfony-bundle

v1.0.2 2017-11-24 10:09 UTC

This package is not auto-updated.

Last update: 2024-09-29 02:08:32 UTC


README

一个以更“优雅”的方式封装EPP连接功能的Symfony Bundle。

Latest Stable Version Total Downloads Latest Unstable Version License Monthly Downloads Daily Downloads composer.lock

安装

步骤 1: 安装Bundle

使用composer要求Bundle

$ composer require xpanel/epp-bundle

步骤 2: 启用Bundle

在AppKernel中注册Bundle

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = [
        // ...
        new Xpanel\Bundle\EppBundle\XpanelEppBundle(),
    ];
}

使用方法

<?php

use Xpanel\Bundle\EppBundle\Exception\EppException;

public function indexAction()
{
    //...

    try {
        $epp = $this->container->get('xpanel_epp');

        $info = array(
            'host' => 'epp.xpanel.com',
            'port' => 700,
            'timeout' => 30,
            'verify_peer' => false,
            'cafile' => '/etc/pki/tls/certs/ca-bundle.crt',
            'local_cert' => '/etc/pki/tls/certs/cert.crt',
            'local_pk' => '/etc/pki/tls/private/private.key',
            'passphrase' => 'XPanel.Online',
            'allow_self_signed' => true
        );
        $epp->connect($info);


        $epp->login(array(
            'clID' => 'Client123',
            'pw' => 'Pass-W0rd',
            'prefix' => 'XP'
        ));


        $checkparams = array(
            'domains' => array('test1.xy','test2.xy')
        );
        $domainCheck = $epp->domainCheck($checkparams);


        $infoparams = array(
            'domainname' => 'test1.xy',
            'authInfoPw' => 'aA1+XPanel+EPP'
        );
        $domainInfo = $epp->domainInfo($infoparams);


        $createparams = array(
            'domainname' => 'test1.xy',
            'period' => 2,
            'nss' => array('NS1.XPANEL.NET','NS2.XPANEL.NET'),
            'registrant' => 'XP-1122334455777',
            'contacts' => array(
                'XP-1122334455777' => 'admin',
                'XP-1122334455777' => 'tech',
                'XP-1122334455777' => 'billing'
                ),
            'authInfoPw' => 'aA1+XPanel+EPP'
        );
        $domainCreate = $epp->domainCreate($createparams);

    }

    catch (EppException $e) {
        echo 'Error: ', $e->getMessage();
    }


echo '<pre>';
print_r($domainCheck);
print_r($domainInfo);
print_r($domainCreate);
echo '</pre>';

    //...
}

问答

欢迎联系我 info@xpanel.com

用♥制作