Class Symfony\Component\Console\Output\ConsoleOutput

InheritanceSymfony\Component\Console\Output\ConsoleOutput » Symfony\Component\Console\Output\StreamOutput » Symfony\Component\Console\Output\Output
ImplementsSymfony\Component\Console\Output\ConsoleOutputInterface, Symfony\Component\Console\Output\OutputInterface

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'));

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
doWrite() {@inheritdoc} Symfony\Component\Console\Output\StreamOutput
hasColorSupport() Returns true if the stream supports colorization. Symfony\Component\Console\Output\StreamOutput
hasStderrSupport() Returns true if current environment supports writing console output to STDERR. Symfony\Component\Console\Output\ConsoleOutput
hasStdoutSupport() Returns true if current environment supports writing console output to STDOUT. Symfony\Component\Console\Output\ConsoleOutput

Method Details

__construct() public method

Constructor.

public void __construct ( $verbosity self::VERBOSITY_NORMAL, $decorated null, Symfony\Component\Console\Formatter\OutputFormatterInterface $formatter null )
$verbosity int

The verbosity level (one of the VERBOSITY constants in OutputInterface)

$decorated bool|null

Whether to decorate messages (null for auto-guessing)

$formatter Symfony\Component\Console\Formatter\OutputFormatterInterface|null

Output formatter instance (null to use default OutputFormatter)

getErrorOutput() public method

{@inheritdoc}

public void getErrorOutput ( )
hasStderrSupport() protected method

Returns true if current environment supports writing console output to STDERR.

protected bool hasStderrSupport ( )
hasStdoutSupport() protected method

Returns true if current environment supports writing console output to STDOUT.

protected bool hasStdoutSupport ( )
setDecorated() public method

{@inheritdoc}

public void setDecorated ( $decorated )
$decorated
setErrorOutput() public method

{@inheritdoc}

public void setErrorOutput ( Symfony\Component\Console\Output\OutputInterface $error )
$error
setFormatter() public method

{@inheritdoc}

public void setFormatter ( Symfony\Component\Console\Formatter\OutputFormatterInterface $formatter )
$formatter
setVerbosity() public method

{@inheritdoc}

public void setVerbosity ( $level )
$level