umpirsky / wisdom
Domain availability checker.
Installs: 177
Dependents: 0
Suggesters: 0
Security: 0
Stars: 121
Watchers: 11
Forks: 18
Open Issues: 1
Requires
- php: >=5.3.3
- react/whois: 0.1.*
Requires (Dev)
- symfony/finder: 2.*
This package is not auto-updated.
Last update: 2024-11-09 14:40:47 UTC
README
symfony upgrade fixer • twig gettext extractor • wisdom • centipede • permissions handler • extraload • gravatar • locurro • country list • transliterator
Wisdom
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