PHP 클래스 think\console\output\driver\Console

파일 보기 프로젝트 열기: top-think/framework 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( Output $output )
getTerminalDimensions ( ) : array 获取当前终端的尺寸
renderException ( Exception $e )
setDecorated ( $decorated )
write ( $messages, $newline = false, $type = Output::OUTPUT_NORMAL, $stream = null )

보호된 메소드들

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

비공개 메소드들

메소드 설명
getMode ( ) : string 获取终端模式
getSttyColumns ( ) : string 获取stty列数
isRunningOS400 ( )
openErrorStream ( ) : resource
openOutputStream ( ) : resource
splitStringByWidth ( $string, $width )
stringWidth ( $string )

메소드 상세

__construct() 공개 메소드

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

doWrite() 보호된 메소드

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

getTerminalDimensions() 공개 메소드

获取当前终端的尺寸
public getTerminalDimensions ( ) : array
리턴 array

getTerminalHeight() 보호된 메소드

获取终端高度
protected getTerminalHeight ( ) : integer | null
리턴 integer | null

getTerminalWidth() 보호된 메소드

获取终端宽度
protected getTerminalWidth ( ) : integer | null
리턴 integer | null

hasColorSupport() 보호된 메소드

是否支持着色
protected hasColorSupport ( $stream ) : boolean
$stream
리턴 boolean

hasStderrSupport() 보호된 메소드

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

hasStdoutSupport() 보호된 메소드

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

renderException() 공개 메소드

public renderException ( Exception $e )
$e Exception

setDecorated() 공개 메소드

public setDecorated ( $decorated )

write() 공개 메소드

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