PHP Class 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.
Inheritance: extends View
Afficher le fichier Open project: atk4/atk4

Méthodes publiques

Свойство Type Description
$callback callable
$color array
$prefix array
$process System_ProcessIO
$streams array

Méthodes publiques

Méthode Description
__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.

Method Details

__destruct() public méthode

public __destruct ( )

_out() public méthode

public _out ( $str )

addStream() public méthode

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

afterAdd() public méthode

public afterAdd ( $me, $o )

defaultTemplate() public méthode

public defaultTemplate ( )

err() public méthode

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

getProcessIO() public méthode

public getProcessIO ( )

jsEval() public méthode

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

out() public méthode

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

render() public méthode

public render ( )

set() public méthode

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

sseMessageJSON() public méthode

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

sseMessageLine() public méthode

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 )

Property Details

$callback public_oe property

public callable $callback
Résultat callable

$color public_oe property

public array $color
Résultat array

$prefix public_oe property

public array $prefix
Résultat array

$process public_oe property

public System_ProcessIO $process
Résultat System_ProcessIO

$streams public_oe property

public array $streams
Résultat array