Awesome
<h3 align="center"> <a href="https://github.com/umpirsky"> <img src="https://farm2.staticflickr.com/1709/25098526884_ae4d50465f_o_d.png" /> </a> </h3> <p align="center"> <a href="https://github.com/umpirsky/Symfony-Upgrade-Fixer">symfony upgrade fixer</a> • <a href="https://github.com/umpirsky/Twig-Gettext-Extractor">twig gettext extractor</a> • <b>wisdom</b> • <a href="https://github.com/umpirsky/centipede">centipede</a> • <a href="https://github.com/umpirsky/PermissionsHandler">permissions handler</a> • <a href="https://github.com/umpirsky/Extraload">extraload</a> • <a href="https://github.com/umpirsky/Gravatar">gravatar</a> • <a href="https://github.com/umpirsky/locurro">locurro</a> • <a href="https://github.com/umpirsky/country-list">country list</a> • <a href="https://github.com/umpirsky/Transliterator">transliterator</a> </p>Wisdom
<img src="https://raw.github.com/umpirsky/wisdom/master/icon/icon.png" />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 theisAvailable
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