$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, integer $verbosity = self::VERBOSITY_NORMAL, boolean|null $decorated = null, \Symfony\Component\Console\Formatter\OutputFormatterInterface|null $formatter = null)
resource | $stream | A stream resource |
integer | $verbosity | The verbosity level (one of the VERBOSITY constants in OutputInterface) |
boolean|null | $decorated | Whether to decorate messages (null for auto-guessing) |
\Symfony\Component\Console\Formatter\OutputFormatterInterface|null | $formatter | Output formatter instance (null to use default OutputFormatter) |
When first argument is not a real stream
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