TYPO3  7.6
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
Output Class Reference
Inheritance diagram for Output:
OutputInterface BufferedOutput StreamOutput TestOutput DummyOutput ConsoleOutput

Public Member Functions

 __construct ($verbosity=self::VERBOSITY_NORMAL, $decorated=false, OutputFormatterInterface $formatter=null)
 
 setFormatter (OutputFormatterInterface $formatter)
 
 getFormatter ()
 
 setDecorated ($decorated)
 
 isDecorated ()
 
 setVerbosity ($level)
 
 getVerbosity ()
 
 isQuiet ()
 
 isVerbose ()
 
 isVeryVerbose ()
 
 isDebug ()
 
 writeln ($messages, $type=self::OUTPUT_NORMAL)
 
 write ($messages, $newline=false, $type=self::OUTPUT_NORMAL)
 

Protected Member Functions

 doWrite ($message, $newline)
 

Private Attributes

 $verbosity
 
 $formatter
 

Additional Inherited Members

- Public Attributes inherited from OutputInterface
const VERBOSITY_QUIET = 0
 
const VERBOSITY_NORMAL = 1
 
const VERBOSITY_VERBOSE = 2
 
const VERBOSITY_VERY_VERBOSE = 3
 
const VERBOSITY_DEBUG = 4
 
const OUTPUT_NORMAL = 0
 
const OUTPUT_RAW = 1
 
const OUTPUT_PLAIN = 2
 

Detailed Description

Base class for output classes.

There are five levels of verbosity:

Author
Fabien Potencier fabie.nosp@m.n@sy.nosp@m.mfony.nosp@m..com

Definition at line 32 of file Output.php.

Constructor & Destructor Documentation

__construct (   $verbosity = self::VERBOSITY_NORMAL,
  $decorated = false,
OutputFormatterInterface  $formatter = null 
)

Constructor.

Parameters
int$verbosityThe verbosity level (one of the VERBOSITY constants in OutputInterface)
bool$decoratedWhether to decorate messages
OutputFormatterInterface | null$formatterOutput formatter instance (null to use default OutputFormatter)

Definition at line 46 of file Output.php.

References Output\$formatter, and Output\$verbosity.

Member Function Documentation

doWrite (   $message,
  $newline 
)
abstractprotected

Writes a message to the output.

Parameters
string$messageA message to write to the output
bool$newlineWhether to add a newline or not

Referenced by Output\write().

getFormatter ( )

{Returns current output formatter instance.

Returns
OutputFormatterInterface
}

Implements OutputInterface.

Definition at line 64 of file Output.php.

References Output\$formatter.

Referenced by ConsoleOutput\__construct().

getVerbosity ( )

{Gets the current verbosity of the output.

Returns
int The current level of verbosity (one of the VERBOSITY constants)
}

Implements OutputInterface.

Definition at line 96 of file Output.php.

References Output\$verbosity.

isDebug ( )

Definition at line 116 of file Output.php.

References Output\$verbosity.

isDecorated ( )

{Gets the decorated flag.

Returns
bool true if the output will decorate messages, false otherwise
}

Implements OutputInterface.

Definition at line 80 of file Output.php.

isQuiet ( )

Definition at line 101 of file Output.php.

References Output\$verbosity.

isVerbose ( )

Definition at line 106 of file Output.php.

References Output\$verbosity.

isVeryVerbose ( )

Definition at line 111 of file Output.php.

References Output\$verbosity.

setDecorated (   $decorated)

{Sets the decorated flag.

Parameters
bool$decoratedWhether to decorate the messages
}

Implements OutputInterface.

Definition at line 72 of file Output.php.

setFormatter ( OutputFormatterInterface  $formatter)

{Sets output formatter.

Parameters
OutputFormatterInterface$formatter
}

Implements OutputInterface.

Definition at line 56 of file Output.php.

References Output\$formatter.

setVerbosity (   $level)

{Sets the verbosity of the output.

Parameters
int$levelThe level of verbosity (one of the VERBOSITY constants)
}

Implements OutputInterface.

Definition at line 88 of file Output.php.

write (   $messages,
  $newline = false,
  $type = self::OUTPUT_NORMAL 
)

{Writes a message to the output.

Parameters
string | array$messagesThe message as an array of lines or a single string
bool$newlineWhether to add a newline
int$typeThe type of output (one of the OUTPUT constants)
Exceptions
\InvalidArgumentExceptionWhen unknown output type is given
}

Implements OutputInterface.

Definition at line 132 of file Output.php.

References Output\doWrite(), OutputInterface\OUTPUT_NORMAL, OutputInterface\OUTPUT_PLAIN, and OutputInterface\OUTPUT_RAW.

Referenced by Output\writeln().

writeln (   $messages,
  $type = self::OUTPUT_NORMAL 
)

{Writes a message to the output and adds a newline at the end.

Parameters
string | array$messagesThe message as an array of lines of a single string
int$typeThe type of output (one of the OUTPUT constants)
Exceptions
\InvalidArgumentExceptionWhen unknown output type is given
}

Implements OutputInterface.

Definition at line 124 of file Output.php.

References Output\write().

Member Data Documentation

$formatter
private
$verbosity
private