$stream
$stream :
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));
__construct(resource $stream, array<mixed,\Symfony\Component\Console\Output\ConsoleSectionOutput> $sections, \Symfony\Component\Console\Output\int $verbosity, \Symfony\Component\Console\Output\bool $decorated, \Symfony\Component\Console\Formatter\OutputFormatterInterface $formatter)
resource | $stream | A stream resource |
array<mixed,\Symfony\Component\Console\Output\ConsoleSectionOutput> | $sections | |
\Symfony\Component\Console\Output\int | $verbosity | The verbosity level (one of the VERBOSITY constants in OutputInterface) |
\Symfony\Component\Console\Output\bool | $decorated | Whether to decorate messages (null for auto-guessing) |
\Symfony\Component\Console\Formatter\OutputFormatterInterface | $formatter | Output formatter instance (null to use default OutputFormatter) |
hasColorSupport() : boolean
Returns true if the stream supports colorization.
Colorization is disabled if not supported by the stream:
This is tricky on Windows, because Cygwin, Msys2 etc emulate pseudo terminals via named pipes, so we can only check the environment.
Reference: Composer\XdebugHandler\Process::supportsColor https://github.com/composer/xdebug-handler
true if the stream supports colorization, false otherwise
popStreamContentUntilCurrentSection(\Symfony\Component\Console\Output\int $numberOfLinesToClearFromCurrentSection)
At initial stage, cursor is at the end of stream output. This method makes cursor crawl upwards until it hits current section. Then it erases content it crawled through. Optionally, it erases part of current section too.
\Symfony\Component\Console\Output\int | $numberOfLinesToClearFromCurrentSection |