The Wayback Machine - https://web.archive.org/web/20201201054854/https://github.com/io-developer/php-whois/issues/122
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

[feature] using library as a parser via StringLoader #122

Open
deepika-maj opened this issue Jun 3, 2020 · 0 comments
Open

[feature] using library as a parser via StringLoader #122

deepika-maj opened this issue Jun 3, 2020 · 0 comments

Comments

@deepika-maj
Copy link

@deepika-maj deepika-maj commented Jun 3, 2020

Is it possible for you to add another loader, something like below, so that the library can be used as a parser without doing actual whois query.

<?php

namespace Iodev\Whois\Loaders;

class StringLoader implements ILoader
{
    private $whoisText;

    public function loadText($whoisHost, $query)
    {
        return $this->whoisText;
    }

    public function setWhoisText($whoisText)
    {
        $this->whoisText = $whoisText;
    }
}

which can be used as:

$whoisClient = Factory::get()->createWhois(new StringLoader());

foreach ($records as $record) {
    $whoisClient->getLoader()->setWhoisText($record['raw_whois_text']);
    $whois = $whoisClient->loadDomainInfo($record['domain']);

    // app logic
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant
You can’t perform that action at this time.