umpirsky/wisdom

Domain availability checker.

0.1.0 2016-03-12 17:23 UTC

This package is not auto-updated.

Last update: 2024-04-13 11:35:52 UTC


README

68747470733a2f2f6661726d322e737461746963666c69636b722e636f6d2f313730392f32353039383532363838345f616534643530343635665f6f5f642e706e67

symfony upgrade fixertwig gettext extractorwisdomcentipedepermissions handlerextraloadgravatarlocurrocountry listtransliterator

Wisdom Build Status

68747470733a2f2f7261772e6769746875622e636f6d2f756d706972736b792f776973646f6d2f6d61737465722f69636f6e2f69636f6e2e706e67

Domain availability checker based on React/Whois.

Example

<?php

$domain = 'umpirsky.com';
$wisdom = new Wisdom($client);
$wisdom
    ->check($domain)
    ->then(function ($available) use ($domain) {
        printf('Domain %s is %s.', $domain, $available ? 'available' : 'taken');
    });

// Outputs:
// Domain umpirsky.com is taken.

See more examples.

Adding support for a TLD

This example uses the ch domain, replace .ch with your own one.

  • First, create the test cases:
$ whois umpirsky-wisdom.ch > tests/Wisdom/Fixtures/whois/umpirsky-wisdom.ch
$ whois google.ch > tests/Wisdom/Fixtures/whois/google.ch
  • Run the tests to make sure they fail.

  • Identify a string in the umpirsky-wisdom variant that identifies the domain as available.

  • Create the Wisdom\Whois\Parser\Tld\Ch class and implement the isAvailable method.

  • Run the tests to make sure they pass.

  • Create a pull request on GitHub.

Tests

To run the test suite, you need PHPUnit.

$ phpunit