Skip to content

Commit

Permalink
init repo; main class for parsing, small test; lib is ready
Browse files Browse the repository at this point in the history
  • Loading branch information
shapito27 committed Oct 29, 2020
1 parent 279f32a commit 9d2308c
Show file tree
Hide file tree
Showing 9 changed files with 2,391 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.idea
/vendor/
.phpunit.result.cache
46 changes: 45 additions & 1 deletion README.md
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"
}
```
37 changes: 37 additions & 0 deletions composer.json
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"
}
}
Loading

0 comments on commit 9d2308c

Please sign in to comment.