Overview

Namespaces

  • Evenement
  • None
  • Peridot
    • Console
    • Core
    • Reporter
    • Runner
    • Scope
    • Test
  • Symfony
    • Component
      • Console
        • Command
        • Descriptor
        • Event
        • Exception
        • Formatter
        • Helper
        • Input
        • Logger
        • Output
        • Question
        • Style
        • Tester
        • Tests
          • Command
          • Descriptor
          • Fixtures
          • Formatter
          • Helper
          • Input
          • Logger
          • Output
          • Style
          • Tester

Classes

  • BufferedOutput
  • ConsoleOutput
  • NullOutput
  • Output
  • StreamOutput

Interfaces

  • ConsoleOutputInterface
  • OutputInterface
  • Overview
  • Namespace
  • Class

Class StreamOutput

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

Symfony\Component\Console\Output\Output implements Symfony\Component\Console\Output\OutputInterface
Extended by Symfony\Component\Console\Output\StreamOutput

Direct known subclasses

Symfony\Component\Console\Output\ConsoleOutput
Namespace: Symfony\Component\Console\Output
Author: Fabien Potencier fabien@symfony.com
Located at Output/StreamOutput.php
Methods summary
public
# __construct( resource $stream, integer $verbosity = self::VERBOSITY_NORMAL, boolean|null $decorated = null, Symfony\Component\Console\Formatter\OutputFormatterInterface $formatter = null )

Constructor.

Constructor.

Parameters

$stream
A stream resource
$verbosity
The verbosity level (one of the VERBOSITY constants in OutputInterface)
$decorated
Whether to decorate messages (null for auto-guessing)
$formatter
Output formatter instance (null to use default OutputFormatter)

Throws

Symfony\Component\Console\Exception\InvalidArgumentException
When first argument is not a real stream

Overrides

Symfony\Component\Console\Output\Output::__construct()
public resource
# getStream( )

Gets the stream attached to this StreamOutput instance.

Gets the stream attached to this StreamOutput instance.

Returns

resource
A stream resource
protected
# doWrite( string $message, boolean $newline )

Writes a message to the output.

Writes a message to the output.

Parameters

$message
A message to write to the output
$newline
Whether to add a newline or not
protected boolean
# hasColorSupport( )

Returns true if the stream supports colorization.

Returns true if the stream supports colorization.

Colorization is disabled if not supported by the stream: - Windows != 10.0.10586 without Ansicon, ConEmu or Mintty - non tty consoles

Returns

boolean
true if the stream supports colorization, false otherwise
Methods inherited from Symfony\Component\Console\Output\Output
getFormatter(), getVerbosity(), isDebug(), isDecorated(), isQuiet(), isVerbose(), isVeryVerbose(), setDecorated(), setFormatter(), setVerbosity(), write(), writeln()
Constants inherited from Symfony\Component\Console\Output\OutputInterface
OUTPUT_NORMAL, OUTPUT_PLAIN, OUTPUT_RAW, VERBOSITY_DEBUG, VERBOSITY_NORMAL, VERBOSITY_QUIET, VERBOSITY_VERBOSE, VERBOSITY_VERY_VERBOSE
Peridot API documentation generated by ApiGen