Git Product home page Git Product logo

epp-client's Introduction

EPP Client

PHP library for communicating with EPP (Extensible Provisioning Protocol) servers.

Library implemented according with next RFCs:

  • RFC 5730 - Extensible Provisioning Protocol (EPP)
  • RFC 3731 - Extensible Provisioning Protocol (EPP) Domain Name Mapping
  • RFC 5732 - Extensible Provisioning Protocol (EPP) Host Mapping
  • RFC 5733 - Extensible Provisioning Protocol (EPP) Contact Mapping
  • RFC 5734 - Extensible Provisioning Protocol (EPP) Transport over TCP
  • RFC 3735 - Guidelines for Extending the Extensible Provisioning Protocol (EPP)

Documentation

Under construction.

Basic usage

<?php

use Monolog\Logger;
use Monolog\Handler\StreamHandler;
use Struzik\EPPClient\Connection\StreamSocketConnection;
use Struzik\EPPClient\NamespaceCollection;
use Struzik\EPPClient\EPPClient;
use Struzik\EPPClient\Request\Session\Login;
use Struzik\EPPClient\Request\Session\Logout;

require_once __DIR__.'/vendor/autoload.php';

$logger = new Logger('EPP Client');
$logger->pushHandler(new StreamHandler('php://output', Logger::DEBUG));

$connection = new StreamSocketConnection(
    [
        'uri' => 'tls://epp.example.com:700',
        'timeout' => 30,
        'context' => [
            'ssl' => [
                'local_cert' => __DIR__.'/certificate.pem',
            ],
        ],
    ],
    $logger
);

$client = new EPPClient($connection, $logger);
$client->getNamespaceCollection()
    ->offsetSet(NamespaceCollection::NS_NAME_ROOT, 'urn:ietf:params:xml:ns:epp-1.0')
    ->offsetSet(NamespaceCollection::NS_NAME_CONTACT, 'urn:ietf:params:xml:ns:contact-1.0')
    ->offsetSet(NamespaceCollection::NS_NAME_HOST, 'urn:ietf:params:xml:ns:host-1.0')
    ->offsetSet(NamespaceCollection::NS_NAME_DOMAIN, 'urn:ietf:params:xml:ns:domain-1.0');

$client->connect();

$request = new Login($client);
$request->setLogin('login')
    ->setPassword('password')
    ->setLanguage('en')
    ->setVersion('1.0');
$response = $client->send($request);

$request = new Logout($client);
$response = $client->send($request);

$client->close();

epp-client's People

Contributors

andpavlenko avatar struzik-vladislav avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.