Skip to content

Latest commit

 

History

History
32 lines (23 loc) · 1.34 KB

output.md

File metadata and controls

32 lines (23 loc) · 1.34 KB

Output

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.

Writers

  • 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.

Custom writer

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.

Further reading