$stream
$stream :
ConsoleOutput is the default class for all CLI output. It uses STDOUT and STDERR.
This class is a convenient wrapper around StreamOutput
for both STDOUT and STDERR.
$output = new ConsoleOutput();
This is equivalent to:
$output = new StreamOutput(fopen('php://stdout', 'w'));
$stdErr = new StreamOutput(fopen('php://stderr', 'w'));
__construct(integer $verbosity = self::VERBOSITY_NORMAL, boolean|null $decorated = null, \app\framework\Component\Console\Output\Formatter\OutputFormatterInterface|null $formatter = null)
integer | $verbosity | The verbosity level (one of the VERBOSITY constants in OutputInterface) |
boolean|null | $decorated | Whether to decorate messages (null for auto-guessing) |
\app\framework\Component\Console\Output\Formatter\OutputFormatterInterface|null | $formatter | Output formatter instance (null to use default OutputFormatter) |
write(string|array $messages, boolean $newline = false, integer $options)
Writes a message to the output.
string|array | $messages | The message as an array of lines or a single string |
boolean | $newline | Whether to add a newline |
integer | $options | A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL |
writeln(string|array $messages, integer $options = self::OUTPUT_NORMAL)
Writes a message to the output and adds a newline at the end.
string|array | $messages | The message as an array of lines of a single string |
integer | $options | A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL |
setFormatter(\app\framework\Component\Console\Output\Formatter\OutputFormatterInterface $formatter)
{@inheritdoc}
\app\framework\Component\Console\Output\Formatter\OutputFormatterInterface | $formatter |
getErrorOutput() : \app\framework\Component\Console\Output\OutputInterface
Gets the OutputInterface for errors.
setErrorOutput(\app\framework\Component\Console\Output\OutputInterface $error)
\app\framework\Component\Console\Output\OutputInterface | $error |
hasColorSupport() : boolean
Returns true if the stream supports colorization.
Colorization is disabled if not supported by the stream:
true if the stream supports colorization, false otherwise