Skip to content

Commit 317f54e

Browse files
committed
Merge pull request #2 from WyriHaximus/master
Cleaned up dns repo to become standalone
2 parents 04f9d83 + 41233c1 commit 317f54e

23 files changed

Lines changed: 23 additions & 1 deletion

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
composer.lock
2+
vendor

.travis.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
language: php
2+
3+
php:
4+
- 5.4
5+
- 5.5
6+
- 5.6
7+
- hhvm
8+
9+
matrix:
10+
allow_failures:
11+
- php: hhvm
12+
13+
before_script:
14+
- composer install --dev --prefer-source

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Dns Component
22

3+
[![Build Status](https://secure.travis-ci.org/reactphp/dns.png?branch=master)](http://travis-ci.org/reactphp/dns)
4+
35
Async DNS resolver.
46

57
The main point of the DNS component is to provide async DNS resolution.
@@ -12,20 +14,23 @@ The most basic usage is to just create a resolver through the resolver
1214
factory. All you need to give it is a nameserver, then you can start resolving
1315
names, baby!
1416

17+
```php
1518
$loop = React\EventLoop\Factory::create();
1619
$factory = new React\Dns\Resolver\Factory();
1720
$dns = $factory->create('8.8.8.8', $loop);
1821

1922
$dns->resolve('igor.io')->then(function ($ip) {
2023
echo "Host: $ip\n";
2124
});
25+
```
2226

2327
But there's more.
2428

2529
## Caching
2630

2731
You can cache results by configuring the resolver to use a `CachedExecutor`:
2832

33+
```php
2934
$loop = React\EventLoop\Factory::create();
3035
$factory = new React\Dns\Resolver\Factory();
3136
$dns = $factory->createCached('8.8.8.8', $loop);
@@ -39,6 +44,7 @@ You can cache results by configuring the resolver to use a `CachedExecutor`:
3944
$dns->resolve('igor.io')->then(function ($ip) {
4045
echo "Host: $ip\n";
4146
});
47+
```
4248

4349
If the first call returns before the second, only one query will be executed.
4450
The second result will be served from cache.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"react/promise": "~2.0"
1111
},
1212
"autoload": {
13-
"psr-4": { "React\\Dns\\": "" }
13+
"psr-4": { "React\\Dns\\": "src" }
1414
},
1515
"extra": {
1616
"branch-alias": {
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)