Network tools Library for PHP with native Yggdrasil / IPv6 support
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
799 B

# net-php
1 year ago
Network Library for PHP with native Yggdrasil support
1 year ago
## Install
`composer require yggverse/net`
1 year ago
## Usage
1 year ago
### Socket
#### Check socket is open
```
var_dump(
\Yggverse\Net\Socket::isOpen('yo.index', 80)
);
```
#### Check host valid
```
var_dump(
1 year ago
\Yggverse\Net\Socket::isHost('yo.index')
1 year ago
);
```
#### Check port valid
```
var_dump(
1 year ago
\Yggverse\Net\Socket::isPort(80)
1 year ago
);
```
### Dig
#### Resolve records
1 year ago
1 year ago
```
var_dump(
\Yggverse\Net\Dig::records('yo.index', ['A', 'AAAA'])
1 year ago
);
```
1 year ago
#### Check hostname valid
1 year ago
1 year ago
```
1 year ago
var_dump(
\Yggverse\Net\Dig::isHostName('yo.index')
1 year ago
);
1 year ago
```
1 year ago
1 year ago
#### Check record valid
1 year ago
1 year ago
```
1 year ago
var_dump(
\Yggverse\Net\Dig::isRecord('A')
1 year ago
);
1 year ago
```
1 year ago
1 year ago
#### Check record value valid
1 year ago
1 year ago
```
1 year ago
var_dump(
\Yggverse\Net\Dig::isRecordValue('A', '127.0.0.1')
1 year ago
);
1 year ago
```