-
-
Notifications
You must be signed in to change notification settings - Fork 111
Closed
Labels
Description
Description of the problem
Output is done to a stream, STDOUT by default, but can be set to an arbitrary stream.
Sometimes this is not flexible enough. For example, I want to write to 2 streams simultaneously. There may also be situations where a stream is not supported by a particular output method.
This could be solved by a custom stream wrapper or filter, but a callback for output would be much simpler. Would it be possible to support that?
Example code
// Example for new callback option. Overrides default stream output.
$options = new ZipStream\Option\Archive();
$options->setOutputCallback(function ($data) {
write_output($data);
});