Console
in package
FinalYes
Table of Contents
Constants
Methods
- getNumberOfColumns() : int
- Returns the number of columns of the terminal.
- hasColorSupport() : bool
- Returns true if STDOUT supports colorization.
- isInteractive() : bool
- Returns if the file descriptor is an interactive terminal or not.
- getNumberOfColumnsInteractive() : int
- getNumberOfColumnsWindows() : int
- isWindows() : bool
Constants
STDERR
public
int
STDERR
= 2
STDIN
public
int
STDIN
= 0
STDOUT
public
int
STDOUT
= 1
Methods
getNumberOfColumns()
Returns the number of columns of the terminal.
public
getNumberOfColumns() : int
Tags
Return values
inthasColorSupport()
Returns true if STDOUT supports colorization.
public
hasColorSupport() : bool
This code has been copied and adapted from Symfony\Component\Console\Output\StreamOutput.
Return values
boolisInteractive()
Returns if the file descriptor is an interactive terminal or not.
public
isInteractive([int|resource $fileDescriptor = self::STDOUT ]) : bool
Normally, we want to use a resource as a parameter, yet sadly it's not always available,
eg when running code in interactive console (php -a
), STDIN/STDOUT/STDERR constants are not defined.
Parameters
- $fileDescriptor : int|resource = self::STDOUT
Return values
boolgetNumberOfColumnsInteractive()
private
getNumberOfColumnsInteractive() : int
Tags
Return values
intgetNumberOfColumnsWindows()
private
getNumberOfColumnsWindows() : int
Tags
Return values
intisWindows()
private
isWindows() : bool