Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

method isAvailable() returns TRUE when extension doesn't exist #32

Open
IvoMiranda opened this issue Feb 21, 2015 · 1 comment
Open

Comments

@IvoMiranda
Copy link

Example:
thisdomain.doesnotexistatall
$domain->isAvailable() returns TRUE

NabiKAZ added a commit to NabiKAZ/php-whois that referenced this issue Mar 11, 2015
…n't exist

Signed-off-by: NabiKAZ <nabikaz@gmail.com>
@NabiKAZ
Copy link

NabiKAZ commented Mar 11, 2015

I fixed this bug.
After accept pull request you can try this:

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

$sld = ' thisdomain.doesnotexistatall';

try {
    $domain = new Phois\Whois\Whois($sld);
} catch (InvalidArgumentException $e) {
    die($e->getMessage()."\n");
}

if ($domain->isAvailable()) {
    echo "Domain is available\n";
} else {
    echo "Domain is registered\n";
}

Output:

Domain name isn't valid!

Or you can get a fork from my repository: https://github.com/NabiKAZ/php-whois/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants