Skip to content

Commit d61ee63

Browse files
committed
Restructure examples to be more accessible
Add root dev dependencies instead of multiple composer.json files
1 parent 19726d3 commit d61ee63

9 files changed

Lines changed: 9 additions & 35 deletions

File tree

composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
"react/stream": "~0.4.0|~0.3.0"
2121
},
2222
"require-dev": {
23-
"phpunit/phpunit": "^5.0 || ^4.8"
23+
"clue/redis-react": "^0.5",
24+
"phpunit/phpunit": "^5.0 || ^4.8",
25+
"react/socket-client": "^0.5"
2426
}
2527
}
File renamed without changes.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
require __DIR__ . '/../../vendor/autoload.php';
3+
require __DIR__ . '/../vendor/autoload.php';
44

55
use Clue\React\Sse\BufferedChannel;
66
use React\Http\Request;
@@ -15,7 +15,7 @@
1515
$http->on('request', function (Request $request, Response $response) use ($channel) {
1616
if ($request->getPath() === '/') {
1717
$response->writeHead('200', array('Content-Type' => 'text/html'));
18-
$response->end(file_get_contents(__DIR__ . '/eventsource.html'));
18+
$response->end(file_get_contents(__DIR__ . '/00-eventsource.html'));
1919
return;
2020
}
2121

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
require __DIR__ . '/vendor/autoload.php';
3+
require __DIR__ . '/../vendor/autoload.php';
44

55
use Clue\React\Sse\BufferedChannel;
66
use React\Http\Request;
@@ -17,7 +17,7 @@
1717
$http->on('request', function (Request $request, Response $response) use ($channel) {
1818
if ($request->getPath() === '/') {
1919
$response->writeHead('200', array('Content-Type' => 'text/html'));
20-
$response->end(file_get_contents(__DIR__ . '/../01-simple-periodic/eventsource.html'));
20+
$response->end(file_get_contents(__DIR__ . '/00-eventsource.html'));
2121
return;
2222
}
2323

examples/02-plaintext-chat/.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

examples/02-plaintext-chat/composer.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

examples/03-redis-pubsub/.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

examples/03-redis-pubsub/composer.json

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
require __DIR__ . '/vendor/autoload.php';
3+
require __DIR__ . '/../vendor/autoload.php';
44

55
use Clue\React\Sse\BufferedChannel;
66
use React\Http\Request;
@@ -16,7 +16,7 @@
1616
$http->on('request', function (Request $request, Response $response) use ($channel) {
1717
if ($request->getPath() === '/') {
1818
$response->writeHead('200', array('Content-Type' => 'text/html'));
19-
$response->end(file_get_contents(__DIR__ . '/../01-simple-periodic/eventsource.html'));
19+
$response->end(file_get_contents(__DIR__ . '/00-eventsource.html'));
2020
return;
2121
}
2222

0 commit comments

Comments
 (0)