PHP 클래스 System_ProcessIO, atk4

상속: extends AbstractModel
파일 보기 프로젝트 열기: atk4/atk4

공개 프로퍼티들

프로퍼티 타입 설명
$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