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
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$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