Skip to content
This repository has been archived by the owner on Jun 3, 2019. It is now read-only.

Question regarding stream usage #7

Closed
harikt opened this issue Aug 14, 2015 · 0 comments
Closed

Question regarding stream usage #7

harikt opened this issue Aug 14, 2015 · 0 comments

Comments

@harikt
Copy link

harikt commented Aug 14, 2015

Hi,

I have a question regarding the stream. Basically I was playing with the streams to find a fix for auraphp/Aura.Http#29 .

This is the code I tried.

<?php
require __DIR__ . '/vendor/autoload.php';

$networkStream = Streamer\NetworkStream::create('https://api.github.com/orgs/auraphp/repos');
print_r($networkStream);

and running it got into exception.

$ php test.php

PHP Warning:  stream_socket_client() expects parameter 6 to be resource, null given in /var/www/github.com/harikt/streamer/vendor/fzaninotto/streamer/Streamer/NetworkStream.php on line 9
PHP Fatal error:  Uncaught exception 'Streamer\Exception\InvalidArgumentException' with message 'A Stream object requires a stream resource as constructor argument' in /var/www/github.com/harikt/streamer/vendor/fzaninotto/streamer/Streamer/Stream.php:25
Stack trace:
#0 /var/www/github.com/harikt/streamer/vendor/fzaninotto/streamer/Streamer/NetworkStream.php(9): Streamer\Stream->__construct(false)
#1 /var/www/github.com/harikt/streamer/test.php(4): Streamer\NetworkStream::create('https://api.git...')
#2 {main}
  thrown in /var/www/github.com/harikt/streamer/vendor/fzaninotto/streamer/Streamer/Stream.php on line 25

Any help to understand / fix this is appreciated.

@harikt harikt closed this as completed Dec 22, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant