Opposite the input sources, there are output writers.
One for STDOUT
and one for STDERR
, as well as one dedicated to write to files.
Output writers expect iterable data and are able to write data line by line; ideal for handling streaming data.
- File: write to a file on the local filesystem.
- STDOUT / STDERR: write to the console.
- Callback: write to a callable handle.
- CSV: write to CSV files.
To implement a custom output writer, the following interfaces and classes are of help:
Symbol | Description |
---|---|
interface ZeroConfig\Cli\Writer\WriterInterface |
To write iterable data. |
interface ZeroConfig\Cli\Writer\DestinationInterface |
Holds a resource handle for writers. |
abstract class ZeroConfig\Cli\Writer\AbstractWriter |
Create a writer based on a resource handle. |