Download the PHP package juanparati/rdap-lib without Composer

On this page you can find all versions of the php package juanparati/rdap-lib. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package rdap-lib

RDAPLib

About

RDAPLib is a Registration Data Access Protocol (RDAP) client library that query and resolve results into models, arrays or standard objects (stdObject).

This library uses Guzzle as default http client, however is possible to inject any custom HTTP client that is compliant with PSR-18.

Installation

composer require juanparati/rdap-lib "^2.0"

You may also require Guzzle 7 in case that you don't want to inject PSR-18 compliant client:

composer require guzzlehttp/guzzle "^7.0.1"

Usage

Basic example

$rdap = new \Juanparati\RDAPLib\RDAPClient();

$ip        = $rdap->ipLookup('94.234.38.5');    
$domain    = $rdap->domainLookup('google.com');
$tld       = $rdap->tldLookup('io');
$entity    = $rdap->entityLookup('APL7-ARIN')
$as        = $rdap->asLookup(1);
$registrar = $rdap->registrarLookup(1);

Output formats

RDAPClient map the result into models, however is possible to return the results using the following types:

The "lookups" method accept a secondary parameter where to specify the format.

Example:

 $rdap = new \Juanparati\RDAPLib\RDAPClient();

 $ip     = $rdap->ipLookup('94.234.38.5', \Juanparati\RDAPLib\RDAPClient\RAW_OUTPUT);    
 $domain = $rdap->domainLookup('google.com', \Juanparati\RDAPLib\RDAPClient\ARRAY_OUTPUT);
 $tld    = $rdap->tldLookup('io', \Juanparati\RDAPLib\RDAPClient\OBJECT_OUTPUT);
 $entity = $rdap->entityLookup('APL7-ARIN')   // Default output is MODEL_OUTPUT

Model format

The model format is suitable when data accessors or extra parameters are required. RDAPClient provides defaults models that are possible to replace. The models are based on RFC-7483.

For example the default method for "vcardArray" provides a method that can parse jCard format.

Example:

$rdap = new \Juanparati\RDAPLib\RDAPClient();

$domain = $rdap->domainLookup('google.com');
$contact = $rdap->entities[0]->vcardArray->parseCard();

The link model has another method that can generate HTML links:

$rdap = new \Juanparati\RDAPLib\RDAPClient();

$domain = $rdap->domainLookup('google.com');
echo $rdap->links[0]->asLink();

It's possible to replace the current models with your own custom models. In order achieve that a custom ModelMapper is required.

Example:

// 1. Define our custom model that extends the default one.
class MyIpAddressModel extends \Juanparati\RDAPLib\Models\IpAddressModel {

    /**
     * Our new method
     */
    public function getFirstIpV4Ip() : ?string {
        return $this->v4[0] ?? null;
    }
}

// 2. Instantiate a custom mapper with the model replacement.   
$mapper = new \Juanparati\RDAPLib\ModelMapper([         
    'ipAddresses'  => \Juanparati\RDAPLib\Models\IpAddressModel::class,            
]);

// 3. Instantiate the client injecting our custom mapper
$rdap = new \Juanparati\RDAPLib\RDAPClient([], null, null, $mapper);

Use different endpoints

By default RDAPLib uses the following endpoints according to the lookup type:

'ip'        => 'https://rdap.db.ripe.net/ip/',
'domain'    => 'https://rdap.org/domain/',
'tld'       => 'https://root.rdap.org/domain/',
'autnum'    => 'https://rdap.db.ripe.net/autnum/',
'entity'    => 'https://rdap.arin.net/registry/entity/',
'registrar' => 'https://registrars.rdap.org/entity/',

It's possible to replace the endpoints passing a new ones into the first parameter of the RDAPClient constructor.

Example:

$rdap = new \Juanparati\RDAPLib\RDAPClient(['ip' => 'https://rdap.org/ip/']);

Use a custom HTTP Client

RDAPLib allows to inject a custom PSR-18 HTTP Client. The client will also require a message interface PSR-7.

Example:

 $rdap = new \Juanparati\RDAPLib\RDAPClient(
    [],
    $myCompatiblePSR18HTTPClient,       // Psr\Http\Client\ClientInterface
    $myCompatiblePSR7MessageInterface   // Psr\Http\Message\RequestFactoryInterface
 );

Supporters


All versions of rdap-lib with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
ext-json Version *
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package juanparati/rdap-lib contains the following files

Loading the files please wait ....