From 33be05e7a27d7dc5746ffc84d00e8bf62a11788e Mon Sep 17 00:00:00 2001 From: nicolus Date: Mon, 21 Oct 2019 13:35:22 +0200 Subject: [PATCH] Update Streaming Adapter example in the documentation --- README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d67b4e1..dbc315c 100644 --- a/README.md +++ b/README.md @@ -468,10 +468,14 @@ Don't have the cURL extension compiled with your PHP install? You can override t // Instantiate a client object $client = new \Phue\Client('10.0.1.1', 'yourusername'); -// Override the default transport -$client->setTransport( - new \Phue\Transport\Adapter\Streaming -); +// Instantiate a new transport +$transport = new \Phue\Transport\Http($client); + +// Use the streaming adapter instead of the default Curl adapter +$transport->setAdapter(new \Phue\Transport\Adapter\Streaming()); + +// Override the default transport with our Streaming transport +$client->setTransport($transport); ``` ### Other commands