class StreamOutput extends Output

StreamOutput writes the output to a given stream.

Usage:

$output = new StreamOutput(fopen('php://stdout', 'w'));

As StreamOutput can use any stream, you can also use a file:

$output = new StreamOutput(fopen('/path/to/output.log', 'a', false));

Methods

__construct(resource $stream, int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = null, OutputFormatterInterface $formatter = null)

No description

resource
getStream()

Gets the stream attached to this StreamOutput instance.

Details

at line line 43
__construct(resource $stream, int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = null, OutputFormatterInterface $formatter = null)

Parameters

resource $stream A stream resource
int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface)
bool $decorated Whether to decorate messages (null for auto-guessing)
OutputFormatterInterface $formatter Output formatter instance (null to use default OutputFormatter)

Exceptions

InvalidArgumentException When first argument is not a real stream

at line line 63
resource getStream()

Gets the stream attached to this StreamOutput instance.

Return Value

resource A stream resource