StreamOutput
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
Constructor.
Writes a message to the output and adds a newline at the end.
Writes a message to the output.
Gets the stream attached to this StreamOutput instance.
Details
at line line 45
__construct(resource $stream, int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = null, OutputFormatterInterface $formatter = null)
Constructor.
in Output at line line 52
setFormatter(OutputFormatterInterface $formatter)
Sets output formatter.
in Output at line line 60
OutputFormatterInterface
getFormatter()
Returns current output formatter instance.
in Output at line line 68
setDecorated(bool $decorated)
Sets the decorated flag.
in Output at line line 76
bool
isDecorated()
Gets the decorated flag.
in Output at line line 84
setVerbosity(int $level)
Sets the verbosity of the output.
in Output at line line 92
int
getVerbosity()
Gets the current verbosity of the output.
in Output at line line 97
isQuiet()
in Output at line line 102
isVerbose()
in Output at line line 107
isVeryVerbose()
in Output at line line 112
isDebug()
in Output at line line 120
writeln(string|array $messages, int $options = self::OUTPUT_NORMAL)
Writes a message to the output and adds a newline at the end.
in Output at line line 128
write(string|array $messages, bool $newline = false, int $options = self::OUTPUT_NORMAL)
Writes a message to the output.
at line line 65
resource
getStream()
Gets the stream attached to this StreamOutput instance.