PHP Класс System_ProcessIO, atk4

Наследование: extends AbstractModel
Показать файл Открыть проект

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

Свойство Тип Описание
$args
$cmd
$descriptorspec allow us to execute commands in a flexible and easy way
$exic_code
$pipes
$process contain descriptions for stdin/out/err
$stderr

Открытые методы

Метод Описание
close ( $res = null ) This function will finish reading from in/err streams and will close all streams. If you are doing your own reading line-by-line or you want to terminate application without reading all of it's output - use terminate() instead;.
debugStatus ( )
exec ( string $cmd, array | string $args = [] ) : self Execute the process and associate with this object.
init ( ) Initialization of the object.
nice ( integer $nice ) Set "nice" value for the process.
readAll ( string $res = 'out' ) : self Reads all output and returns. Closes stdout when EOF reached.
readLine ( string $res = 'out' ) : self Reads one line of output. Careful - if no output is provided it this function will be waiting.
readStdErr ( )
read_all ( $res = 'out' )
read_line ( $res = 'out' )
read_stderr ( )
terminate ( integer $sig = null ) Closing IO and terminating.
write ( string $str ) : self Sends string to process, but process will wait for more input. Always adds newline at the end.
writeAll ( string $str ) : self Similar to write but will send EOF after sending text.
write_all ( $str )

Защищенные методы

Метод Описание
executeRaw ( string $command ) : array This function just executes command and returns hash of descriptors.
execute_raw ( $command )

Описание методов

close() публичный Метод

This function will finish reading from in/err streams and will close all streams. If you are doing your own reading line-by-line or you want to terminate application without reading all of it's output - use terminate() instead;.
public close ( $res = null )

debugStatus() публичный Метод

public debugStatus ( )

exec() публичный Метод

Execute the process and associate with this object.
public exec ( string $cmd, array | string $args = [] ) : self
$cmd string Command to be executed
$args array | string Arguments (strings)
Результат self

executeRaw() защищенный Метод

Hash will have keys 'in', 'out' and 'err'. This is a handy function to override if you are piping input and output through sockets (such as SSH connection)
protected executeRaw ( string $command ) : array
$command string raw and proprely escaped command
Результат array of pipes

execute_raw() защищенный Метод

protected execute_raw ( $command )

init() публичный Метод

Initialization of the object.
public init ( )

nice() публичный Метод

Set "nice" value for the process.
public nice ( integer $nice )
$nice integer Nice level 0 .. 20

readAll() публичный Метод

Reads all output and returns. Closes stdout when EOF reached.
public readAll ( string $res = 'out' ) : self
$res string optional descriptor (out or err)
Результат self

readLine() публичный Метод

Reads one line of output. Careful - if no output is provided it this function will be waiting.
public readLine ( string $res = 'out' ) : self
$res string optional descriptor (either out or err)
Результат self

readStdErr() публичный Метод

public readStdErr ( )

read_all() публичный Метод

public read_all ( $res = 'out' )

read_line() публичный Метод

public read_line ( $res = 'out' )

read_stderr() публичный Метод

public read_stderr ( )

terminate() публичный Метод

Closing IO and terminating.
public terminate ( integer $sig = null )
$sig integer Unix signal

write() публичный Метод

Sends string to process, but process will wait for more input. Always adds newline at the end.
public write ( string $str ) : self
$str string any input data.
Результат self

writeAll() публичный Метод

Also makes sure your list do not end with endline (because write adds it).
public writeAll ( string $str ) : self
$str string any input data.
Результат self

write_all() публичный Метод

public write_all ( $str )

Описание свойств

$args публичное свойство

public $args

$cmd публичное свойство

public $cmd

$descriptorspec публичное свойство

allow us to execute commands in a flexible and easy way
public $descriptorspec

$exic_code публичное свойство

public $exic_code

$pipes публичное свойство

public $pipes

$process публичное свойство

contain descriptions for stdin/out/err
public $process

$stderr публичное свойство

public $stderr