PHP Class think\console\output\driver\Console

Afficher le fichier Open project: top-think/framework Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( Output $output )
getTerminalDimensions ( ) : array 获取当前终端的尺寸
renderException ( Exception $e )
setDecorated ( $decorated )
write ( $messages, $newline = false, $type = Output::OUTPUT_NORMAL, $stream = null )

Méthodes protégées

Méthode Description
doWrite ( string $message, boolean $newline, null $stream = null ) 将消息写入到输出。
getTerminalHeight ( ) : integer | null 获取终端高度
getTerminalWidth ( ) : integer | null 获取终端宽度
hasColorSupport ( $stream ) : boolean 是否支持着色
hasStderrSupport ( ) : boolean 当前环境是否支持写入控制台输出到stderr.
hasStdoutSupport ( ) : boolean 当前环境是否支持写入控制台输出到stdout.

Private Methods

Méthode Description
getMode ( ) : string 获取终端模式
getSttyColumns ( ) : string 获取stty列数
isRunningOS400 ( )
openErrorStream ( ) : resource
openOutputStream ( ) : resource
splitStringByWidth ( $string, $width )
stringWidth ( $string )

Method Details

__construct() public méthode

public __construct ( Output $output )
$output think\console\Output

doWrite() protected méthode

将消息写入到输出。
protected doWrite ( string $message, boolean $newline, null $stream = null )
$message string 消息
$newline boolean 是否另起一行
$stream null

getTerminalDimensions() public méthode

获取当前终端的尺寸
public getTerminalDimensions ( ) : array
Résultat array

getTerminalHeight() protected méthode

获取终端高度
protected getTerminalHeight ( ) : integer | null
Résultat integer | null

getTerminalWidth() protected méthode

获取终端宽度
protected getTerminalWidth ( ) : integer | null
Résultat integer | null

hasColorSupport() protected méthode

是否支持着色
protected hasColorSupport ( $stream ) : boolean
$stream
Résultat boolean

hasStderrSupport() protected méthode

当前环境是否支持写入控制台输出到stderr.
protected hasStderrSupport ( ) : boolean
Résultat boolean

hasStdoutSupport() protected méthode

当前环境是否支持写入控制台输出到stdout.
protected hasStdoutSupport ( ) : boolean
Résultat boolean

renderException() public méthode

public renderException ( Exception $e )
$e Exception

setDecorated() public méthode

public setDecorated ( $decorated )

write() public méthode

public write ( $messages, $newline = false, $type = Output::OUTPUT_NORMAL, $stream = null )