Fully Qualified Name: | Zend\Stdlib\ConsoleHelper |
Utilities for console tooling.
Provides the following facilities:
<info>message</info>
,
<error>message</error>
)Colorization will only occur when expected sequences are discovered, and then, only if the console terminal allows it.
Essentially, provides the bare minimum to allow you to provide messages to the current console.
Name | Description | Defined By |
---|---|---|
__construct() | ConsoleHelper | |
colorize() | Colorize a string for use with the terminal. | ConsoleHelper |
write() | ConsoleHelper | |
writeErrorMessage() | Emit an error message. | ConsoleHelper |
writeLine() | ConsoleHelper |
Parameter Name | Type | Description |
---|---|---|
$resource | resource |
Returns:
Colorize a string for use with the terminal.
Takes strings formatted as <key>string</key>
and formats them per the
$highlightMap; if color support is disabled, simply removes the formatting
tags.
Parameter Name | Type | Description |
---|---|---|
$string | string |
Returns: string
Parameter Name | Type | Description |
---|---|---|
$string | string | |
$colorize | bool | Whether |
$resource | resource | Defaults |
Returns: void
Emit an error message.
Wraps the message in <error></error>
, and passes it to writeLine()
,
using STDERR as the resource; emits an additional empty line when done,
also to STDERR.
Parameter Name | Type | Description |
---|---|---|
$message | string |
Returns: void
Parameter Name | Type | Description |
---|---|---|
$string | string | |
$colorize | bool | Whether |
$resource | resource | Defaults |
Returns: void