Skip to content

Commit 6212f3e

Browse files
authored
Merge pull request #522 from clue-labs/drop-ringcentral
Drop leftover RingCentral PSR-7 dependency, use own PSR-7 implementation
2 parents b5c98da + 30c802c commit 6212f3e

15 files changed

+19
-24
lines changed

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@
3333
"react/event-loop": "^1.2",
3434
"react/promise": "^3 || ^2.3 || ^1.2.1",
3535
"react/socket": "^1.12",
36-
"react/stream": "^1.2",
37-
"ringcentral/psr7": "^1.2"
36+
"react/stream": "^1.2"
3837
},
3938
"require-dev": {
4039
"clue/http-proxy-react": "^1.8",

examples/01-client-get-request.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
$client = new Browser();
99

1010
$client->get('http://google.com/')->then(function (ResponseInterface $response) {
11-
var_dump($response->getHeaders(), (string)$response->getBody());
11+
echo (string) $response->getBody();
1212
}, function (Exception $e) {
1313
echo 'Error: ' . $e->getMessage() . PHP_EOL;
1414
});

examples/02-client-concurrent-requests.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@
88
$client = new Browser();
99

1010
$client->head('http://www.github.com/clue/http-react')->then(function (ResponseInterface $response) {
11-
var_dump($response->getHeaders(), (string)$response->getBody());
11+
echo (string) $response->getBody();
1212
}, function (Exception $e) {
1313
echo 'Error: ' . $e->getMessage() . PHP_EOL;
1414
});
1515

1616
$client->get('http://google.com/')->then(function (ResponseInterface $response) {
17-
var_dump($response->getHeaders(), (string)$response->getBody());
17+
echo (string) $response->getBody();
1818
}, function (Exception $e) {
1919
echo 'Error: ' . $e->getMessage() . PHP_EOL;
2020
});
2121

2222
$client->get('http://www.lueck.tv/psocksd')->then(function (ResponseInterface $response) {
23-
var_dump($response->getHeaders(), (string)$response->getBody());
23+
echo (string) $response->getBody();
2424
}, function (Exception $e) {
2525
echo 'Error: ' . $e->getMessage() . PHP_EOL;
2626
});

examples/04-client-post-json.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
),
2323
json_encode($data)
2424
)->then(function (ResponseInterface $response) {
25-
echo (string)$response->getBody();
25+
echo (string) $response->getBody();
2626
}, function (Exception $e) {
2727
echo 'Error: ' . $e->getMessage() . PHP_EOL;
2828
});

examples/05-client-put-xml.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
),
2020
$xml->asXML()
2121
)->then(function (ResponseInterface $response) {
22-
echo (string)$response->getBody();
22+
echo (string) $response->getBody();
2323
}, function (Exception $e) {
2424
echo 'Error: ' . $e->getMessage() . PHP_EOL;
2525
});

examples/11-client-http-proxy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
// demo fetching HTTP headers (or bail out otherwise)
2727
$browser->get('https://www.google.com/')->then(function (ResponseInterface $response) {
28-
echo RingCentral\Psr7\str($response);
28+
echo (string) $response->getBody();
2929
}, function (Exception $e) {
3030
echo 'Error: ' . $e->getMessage() . PHP_EOL;
3131
});

examples/12-client-socks-proxy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
// demo fetching HTTP headers (or bail out otherwise)
2727
$browser->get('https://www.google.com/')->then(function (ResponseInterface $response) {
28-
echo RingCentral\Psr7\str($response);
28+
echo (string) $response->getBody();
2929
}, function (Exception $e) {
3030
echo 'Error: ' . $e->getMessage() . PHP_EOL;
3131
});

examples/13-client-ssh-proxy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
// demo fetching HTTP headers (or bail out otherwise)
2323
$browser->get('https://www.google.com/')->then(function (ResponseInterface $response) {
24-
echo RingCentral\Psr7\str($response);
24+
echo (string) $response->getBody();
2525
}, function (Exception $e) {
2626
echo 'Error: ' . $e->getMessage() . PHP_EOL;
2727
});

examples/14-client-unix-domain-sockets.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
use React\Http\Browser;
55
use React\Socket\FixedUriConnector;
66
use React\Socket\UnixConnector;
7-
use RingCentral\Psr7;
87

98
require __DIR__ . '/../vendor/autoload.php';
109

@@ -18,7 +17,7 @@
1817

1918
// demo fetching HTTP headers (or bail out otherwise)
2019
$browser->get('http://localhost/info')->then(function (ResponseInterface $response) {
21-
echo Psr7\str($response);
20+
echo (string) $response->getBody();
2221
}, function (Exception $e) {
2322
echo 'Error: ' . $e->getMessage() . PHP_EOL;
2423
});

examples/21-client-request-streaming-to-stdout.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
use Psr\Http\Message\ResponseInterface;
55
use React\Stream\ReadableStreamInterface;
66
use React\Stream\WritableResourceStream;
7-
use RingCentral\Psr7;
87

98
require __DIR__ . '/../vendor/autoload.php';
109

@@ -22,7 +21,7 @@
2221
$info->write('Requesting ' . $url . '' . PHP_EOL);
2322

2423
$client->requestStreaming('GET', $url)->then(function (ResponseInterface $response) use ($info, $out) {
25-
$info->write('Received' . PHP_EOL . Psr7\str($response));
24+
$info->write('Received ' . $response->getStatusCode() . ' ' . $response->getReasonPhrase() . PHP_EOL);
2625

2726
$body = $response->getBody();
2827
assert($body instanceof ReadableStreamInterface);

0 commit comments

Comments
 (0)