Skip to content

Commit a6acf40

Browse files
committed
Merge branch 'refs/heads/standalone'
2 parents 8cac929 + 4b64274 commit a6acf40

10 files changed

+28
-7
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
composer.lock
2+
vendor

.travis.yml

+14
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

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Socket Component
22

3+
[![Build Status](https://secure.travis-ci.org/reactphp/socket.png?branch=master)](http://travis-ci.org/reactphp/socket)
4+
35
Library for building an evented socket server.
46

57
The socket component provides a more usable interface for a socket-layer
@@ -18,7 +20,7 @@ or in a client context.
1820
## Usage
1921

2022
Here is a server that closes the connection if you send it anything.
21-
23+
```php
2224
$loop = React\EventLoop\Factory::create();
2325

2426
$socket = new React\Socket\Server($loop);
@@ -34,15 +36,15 @@ Here is a server that closes the connection if you send it anything.
3436
$socket->listen(1337);
3537

3638
$loop->run();
37-
39+
```
3840
You can change the host the socket is listening on through a second parameter
3941
provided to the listen method:
40-
42+
```php
4143
$socket->listen(1337, '192.168.0.1');
42-
44+
```
4345
Here's a client that outputs the output of said server and then attempts to
4446
send it a string.
45-
47+
```php
4648
$loop = React\EventLoop\Factory::create();
4749

4850
$client = stream_socket_client('tcp://127.0.0.1:1337');
@@ -51,3 +53,4 @@ send it a string.
5153
$conn->write("Hello World!\n");
5254

5355
$loop->run();
56+
```

composer.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
"react/stream": "0.4.*"
1111
},
1212
"autoload": {
13-
"psr-4": { "React\\Socket\\": "" }
13+
"psr-4": {
14+
"React\\Socket\\": "src"
15+
}
1416
},
1517
"extra": {
1618
"branch-alias": {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

tests/bootstrap.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
$loader = @include __DIR__ . '/../vendor/autoload.php';
44
if (!$loader) {
5-
$loader = require __DIR__ . '/../../../vendor/autoload.php';
5+
$loader = require __DIR__ . '/../../../../vendor/autoload.php';
66
}
77
$loader->addPsr4('React\\Tests\\Socket\\', __DIR__);

0 commit comments

Comments
 (0)