-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
init repo; main class for parsing, small test; lib is ready
- Loading branch information
Showing
9 changed files
with
2,391 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.idea | ||
/vendor/ | ||
.phpunit.result.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,46 @@ | ||
# whois | ||
Parse whois response | ||
Lib for parsing whois response. | ||
It takes response from any whois server and return object with structured data. | ||
|
||
##Example | ||
**Input**: response of shell command ```whois facebook.com``` pass as ```$whoisText``` | ||
``` | ||
$parser = new WhoisParser($whoisText); | ||
$whoisObject = $parser->run(); | ||
var_dump($whoisObject); | ||
``` | ||
|
||
**Output**: | ||
``` | ||
["status"]=> | ||
int(1) | ||
["errorMessage"]=> | ||
NULL | ||
["nameServers"]=> | ||
array(4) { | ||
[0]=> | ||
string(17) "a.ns.facebook.com" | ||
[1]=> | ||
string(17) "b.ns.facebook.com" | ||
[2]=> | ||
string(17) "c.ns.facebook.com" | ||
[3]=> | ||
string(17) "d.ns.facebook.com" | ||
} | ||
["registrar"]=> | ||
object(Shapito27\Whois\DTO\Registrar)#52 (2) { | ||
["id"]=> | ||
string(4) "3237" | ||
["name"]=> | ||
string(18) "RegistrarSafe, LLC" | ||
} | ||
["creationDate"]=> | ||
string(20) "1997-03-29T05:00:00Z" | ||
["updateDate"]=> | ||
string(20) "2020-03-10T18:53:59Z" | ||
["expirationDate"]=> | ||
string(20) "2028-03-30T04:00:00Z" | ||
["registryDomainId"]=> | ||
string(23) "2320948_DOMAIN_COM-VRSN" | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"name": "shapito27/whois-parser", | ||
"description": "Lib to parse whois response", | ||
"keywords": ["whois","parser"], | ||
"version": "1.0.0", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Ruslan Saifullin", | ||
"email": "legionerust@yandex.ru", | ||
"homepage": "https://thisis-blog.ru" | ||
} | ||
], | ||
"require": { | ||
"php": ">=7.1", | ||
"ext-json": "*" | ||
}, | ||
"require-dev": { | ||
"squizlabs/php_codesniffer": "^3.5", | ||
"phpunit/phpunit": "^9.4" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Shapito27\\Whois\\": "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Shapito27\\Tests\\": "tests/" | ||
} | ||
}, | ||
"scripts": { | ||
"check-style": "./vendor/bin/phpcs -p --standard=PSR12 src/ tests/", | ||
"fix-style": "./vendor/bin/phpcbf -p --standard=PSR12 src/ tests/", | ||
"test": "./vendor/bin/phpunit --colors=always --verbose -c ./phpunit.xml.dist" | ||
} | ||
} |
Oops, something went wrong.