PHP 클래스 View_Console, atk4

There are several usage patters with the console. The simplest is to excetue a process and have it's output streamed into the console in real-time. You can manually specify a call-back method which will be executed and you can send regular and error output to the console with simple methods out() ond err(). Finally - you can supply several streams which cosole will read from and output to the browser until streams are closed.
상속: extends View
파일 보기 프로젝트 열기: atk4/atk4

공개 프로퍼티들

프로퍼티 타입 설명
$callback callable
$color array
$prefix array
$process System_ProcessIO
$streams array

공개 메소드들

메소드 설명
__destruct ( )
_out ( $str )
addStream ( $stream, $prefix = null, $color = null )
afterAdd ( $me, $o )
defaultTemplate ( )
err ( $str ) Displays error on the console (in red).
getProcessIO ( )
jsEval ( $str ) Add ability to send javascript.
out ( $str, $opt = [] ) Displays output in the console.
render ( )
set ( callable $callback ) Evaluates piece of code.
sseMessageJSON ( $text, $id = null ) Sends text or structured data through SSE channel encoded in JSON format. You may supply id argument.
sseMessageLine ( $text, $id = null ) Sends text through SSE channel. Text may contain newlines which will be transmitted proprely. Optionally you can specify ID also.

메소드 상세

__destruct() 공개 메소드

public __destruct ( )

_out() 공개 메소드

public _out ( $str )

addStream() 공개 메소드

public addStream ( $stream, $prefix = null, $color = null )

afterAdd() 공개 메소드

public afterAdd ( $me, $o )

defaultTemplate() 공개 메소드

public defaultTemplate ( )

err() 공개 메소드

Displays error on the console (in red).
public err ( $str )

getProcessIO() 공개 메소드

public getProcessIO ( )

jsEval() 공개 메소드

Add ability to send javascript.
public jsEval ( $str )

out() 공개 메소드

Displays output in the console.
public out ( $str, $opt = [] )

render() 공개 메소드

public render ( )

set() 공개 메소드

Evaluates piece of code.
public set ( callable $callback )
$callback callable function($console)

sseMessageJSON() 공개 메소드

Sends text or structured data through SSE channel encoded in JSON format. You may supply id argument.
public sseMessageJSON ( $text, $id = null )

sseMessageLine() 공개 메소드

Sends text through SSE channel. Text may contain newlines which will be transmitted proprely. Optionally you can specify ID also.
public sseMessageLine ( $text, $id = null )

프로퍼티 상세

$callback 공개적으로 프로퍼티

public callable $callback
리턴 callable

$color 공개적으로 프로퍼티

public array $color
리턴 array

$prefix 공개적으로 프로퍼티

public array $prefix
리턴 array

$process 공개적으로 프로퍼티

public System_ProcessIO $process
리턴 System_ProcessIO

$streams 공개적으로 프로퍼티

public array $streams
리턴 array