chanshige/whois

'chanshige/whois' is that helps your domain registered information(whois) search.

v1.0.3 2018-06-11 05:26 UTC

README

Build Status Coverage Status

chanshige/whois

domain registered information(whois) search. It internally uses Symfony Yaml Component

Installation

With Composer

$ composer require chanshige/whois 'v1.0.2'

usage

<?php
require __DIR__ . '/vendor/autoload.php';

$whois = new \Chanshige\Whois();

try {
    $whois->query('shigeki.tokyo', 'whois.nic.tokyo');
    $result = $whois->hasRawOnlyResult() ? $whois->raw() : $whois->result();
    
    var_dump($result);
} catch (Exception $e) {
    var_dump($e->getMessage());
}

result type

  • isRegistered()
    登録済みドメインかどうか(bool)

  • isReserved()
    予約文字列かどうか(bool)

  • isClientHold()
    ClientHoldとなっているかどうか(bool)

  • result()
    上3つとWHOISを細分化したデータを返す(array)

'domain_name' => string,
'tld' => string,
'registered' => bool,
'reserved' => bool,
'client_hold' => bool,
'detail' => [
   'registrant' => array(),
   'admin' => array(),
   'tech' => array(),
   'billing' => array(),
   'status' => array(),
   'date' => array(),
   'name_server' => array(),
],
'raw' => array()
  • raw()
    加工せず取得したデータのまま返す(array)

  • hasRawOnlyResult()
    raw()のみで結果を確認する必要があるtldかどうか(bool)
    ※ result()で表現できないフォーマットがあるため、判定材料に利用してください。

test (with coverage)

$ composer test