Skip to content

Commit 64b1c6e

Browse files
committed
Update to clue/reactphp-buzz v2.9.0
1 parent fa4c041 commit 64b1c6e

File tree

3 files changed

+48
-68
lines changed

3 files changed

+48
-68
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
},
1919
"require": {
2020
"php": ">=5.3",
21-
"clue/buzz-react": "^2.0",
21+
"clue/buzz-react": "^2.9",
2222
"clue/json-stream": "^0.1",
2323
"react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3",
2424
"react/promise": "^2.0 || ^1.1",

src/Client.php

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ public function events($since = null, $until = null, $filters = array())
161161
public function eventsStream($since = null, $until = null, $filters = array())
162162
{
163163
return $this->streamingParser->parseJsonStream(
164-
$this->browser->withOptions(array('streaming' => true))->get(
164+
$this->browser->requestStreaming(
165+
'GET',
165166
$this->uri->expand(
166167
'/events{?since,until,filters}',
167168
array(
@@ -352,7 +353,7 @@ public function containerLogsStream($container, $follow = false, $stdout = true,
352353

353354
// first inspect container to check TTY setting, then request logs with appropriate log parser
354355
return \React\Promise\Stream\unwrapReadable($this->containerInspect($container)->then(function ($info) use ($url, $browser, $parser, $stderrEvent) {
355-
$stream = $parser->parsePlainStream($browser->withOptions(array('streaming' => true))->get($url));
356+
$stream = $parser->parsePlainStream($browser->requestStreaming('GET', $url));
356357

357358
if (!$info['Config']['Tty']) {
358359
$stream = $parser->demultiplexStream($stream, $stderrEvent);
@@ -438,7 +439,8 @@ public function containerExport($container)
438439
public function containerExportStream($container)
439440
{
440441
return $this->streamingParser->parsePlainStream(
441-
$this->browser->withOptions(array('streaming' => true))->get(
442+
$this->browser->requestStreaming(
443+
'GET',
442444
$this->uri->expand(
443445
'/containers/{container}/export',
444446
array(
@@ -495,7 +497,8 @@ public function containerStats($container)
495497
public function containerStatsStream($container)
496498
{
497499
return $this->streamingParser->parseJsonStream(
498-
$this->browser->withOptions(array('streaming' => true))->get(
500+
$this->browser->requestStreaming(
501+
'GET',
499502
$this->uri->expand(
500503
'/containers/{container}/stats',
501504
array(
@@ -762,7 +765,7 @@ public function containerAttachStream($container, $logs = false, $stream = false
762765

763766
// first inspect container to check TTY setting, then attach with appropriate log parser
764767
return \React\Promise\Stream\unwrapReadable($this->containerInspect($container)->then(function ($info) use ($url, $browser, $parser, $stderrEvent) {
765-
$stream = $parser->parsePlainStream($browser->withOptions(array('streaming' => true))->post($url));
768+
$stream = $parser->parsePlainStream($browser->requestStreaming('POST', $url));
766769

767770
if (!$info['Config']['Tty']) {
768771
$stream = $parser->demultiplexStream($stream, $stderrEvent);
@@ -878,7 +881,8 @@ public function containerArchive($container, $path)
878881
public function containerArchiveStream($container, $path)
879882
{
880883
return $this->streamingParser->parsePlainStream(
881-
$this->browser->withOptions(array('streaming' => true))->get(
884+
$this->browser->requestStreaming(
885+
'GET',
882886
$this->uri->expand(
883887
'/containers/{container}/archive{?path}',
884888
array(
@@ -968,7 +972,8 @@ public function imageCreate($fromImage = null, $fromSrc = null, $repo = null, $t
968972
public function imageCreateStream($fromImage = null, $fromSrc = null, $repo = null, $tag = null, $registry = null, $registryAuth = null)
969973
{
970974
return $this->streamingParser->parseJsonStream(
971-
$this->browser->withOptions(array('streaming' => true))->post(
975+
$this->browser->requestStreaming(
976+
'POST',
972977
$this->uri->expand(
973978
'/images/create{?fromImage,fromSrc,repo,tag,registry}',
974979
array(
@@ -1075,7 +1080,8 @@ public function imagePush($image, $tag = null, $registry = null, $registryAuth =
10751080
public function imagePushStream($image, $tag = null, $registry = null, $registryAuth = null)
10761081
{
10771082
return $this->streamingParser->parseJsonStream(
1078-
$this->browser->withOptions(array('streaming' => true))->post(
1083+
$this->browser->requestStreaming(
1084+
'POST',
10791085
$this->uri->expand(
10801086
'/images{/registry}/{image}/push{?tag}',
10811087
array(
@@ -1303,7 +1309,8 @@ public function execStartDetached($exec, $tty = false)
13031309
public function execStartStream($exec, $tty = false, $stderrEvent = null)
13041310
{
13051311
$stream = $this->streamingParser->parsePlainStream(
1306-
$this->browser->withOptions(array('streaming' => true))->post(
1312+
$this->browser->requestStreaming(
1313+
'POST',
13071314
$this->uri->expand(
13081315
'/exec/{exec}/start',
13091316
array(

0 commit comments

Comments
 (0)