Skip to content

Conversation

@lpotherat
Copy link

Allow the class to directly stream to browser without stream. Useful to write large json data to browser on low memory conditions.

Allow the class to directly stream to browser without stream. Useful to write large json data to browser on low memory conditions.
@rayward
Copy link
Owner

rayward commented Feb 27, 2014

Thanks for the idea, but you can do this already by creating a stream to the output buffer:

$s = fopen('php://output', 'w');
$encoder = new Encoder($s);

You can see some other inbuilt wrappers PHP offers here - http://www.php.net/manual/en/wrappers.php.php

@lpotherat
Copy link
Author

That's what I searched for before modifying the class with echo :). I'm not familiar with streams, and I did not know about this type of stream.
I rollback the changes and use php:://output instead, thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants