PHP Класс PHPDaemon\Core\ShellCommand

Автор: Vasily Zorin ([email protected])
Наследование: extends PHPDaemon\Network\IOStream
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$binPath Executable path
$chroot Chroot
$cwd Chdir
$setGroup SGID
$setUser SUID

Защищенные свойства (Protected)

Свойство Тип Описание
$EOF Got EOF?
$args Array of arguments
$bevErr EventBufferEvent
$bevWrite EventBufferEvent
$cmd Command string
$env Hash of environment's variables
$errlogfile Path to error logfile
$fdWrite FD write
$finishWrite
$nice Process priority
$outputErrors Output errors?
$pd Process descriptor
$pipes Opened pipes

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

Метод Описание
buildArgs ( array $args ) : string Build arguments string from associative/enumerated array (may be mixed)
close ( ) : void Close the process
closeWrite ( ) : this Close write stream
eof ( ) : boolean Got EOF?
exec ( string $binPath = null, callable $cb = null, array $args = null, array $env = null ) Execute
execute ( string $binPath = null, array $args = null, array $env = null ) : this Execute
finishWrite ( ) : boolean Finish write stream
getCmd ( ) : string Get command string
getStatus ( )
nice ( integer $nice = null ) : this Set priority
onEOF ( callable $cb = null ) : this Sets callback which will be called once when got EOF
onEofEvent ( ) : void Called when got EOF
onFinish ( ) Called when stream is finished
setArgs ( $args = null ) : this Sets an array of arguments
setChroot ( string $dir ) : this Set chroot
setCwd ( string $dir ) : this Set cwd
setEnv ( $env = null ) : this Set a hash of environment's variables
setFd ( resource $fd, EventBufferEvent $bev = null ) : void Sets fd
setGroup ( $val ) : this Set group
setUser ( string $val ) : this Set group
write ( string $data ) : boolean Send data to the connection. Note that it just writes to buffer that flushes at every baseloop
writeln ( $data ) : boolean Send data and appending \n to connection. Note that it just writes to buffer flushed at every baseloop

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

Метод Описание
onRead ( ) : this | null Called when new data received

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

buildArgs() публичный статический Метод

Build arguments string from associative/enumerated array (may be mixed)
public static buildArgs ( array $args ) : string
$args array
Результат string

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

Close the process
public close ( ) : void
Результат void

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

Close write stream
public closeWrite ( ) : this
Результат this

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

Got EOF?
public eof ( ) : boolean
Результат boolean

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

Execute
public static exec ( string $binPath = null, callable $cb = null, array $args = null, array $env = null )
$binPath string Binpath
$cb callable Callback
$args array Optional. Arguments
$env array Optional. Hash of environment's variables

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

Execute
public execute ( string $binPath = null, array $args = null, array $env = null ) : this
$binPath string Optional. Binpath
$args array Optional. Arguments
$env array Optional. Hash of environment's variables
Результат this

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

Finish write stream
public finishWrite ( ) : boolean
Результат boolean

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

Get command string
public getCmd ( ) : string
Результат string

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

public getStatus ( )

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

Set priority
public nice ( integer $nice = null ) : this
$nice integer Priority
Результат this

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

Sets callback which will be called once when got EOF
public onEOF ( callable $cb = null ) : this
$cb callable
Результат this

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

Called when got EOF
public onEofEvent ( ) : void
Результат void

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

Called when stream is finished
public onFinish ( )

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

Called when new data received
protected onRead ( ) : this | null
Результат this | null

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

Sets an array of arguments
public setArgs ( $args = null ) : this
Результат this

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

Set chroot
public setChroot ( string $dir ) : this
$dir string
Результат this

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

Set cwd
public setCwd ( string $dir ) : this
$dir string
Результат this

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

Set a hash of environment's variables
public setEnv ( $env = null ) : this
Результат this

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

Sets fd
public setFd ( resource $fd, EventBufferEvent $bev = null ) : void
$fd resource File descriptor
$bev EventBufferEvent
Результат void

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

Set group
public setGroup ( $val ) : this
Результат this

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

Set group
public setUser ( string $val ) : this
$val string
Результат this

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

Send data to the connection. Note that it just writes to buffer that flushes at every baseloop
public write ( string $data ) : boolean
$data string Data to send
Результат boolean Success

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

Send data and appending \n to connection. Note that it just writes to buffer flushed at every baseloop
public writeln ( $data ) : boolean
Результат boolean Success

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

$EOF защищенное свойство

Got EOF?
protected $EOF

$args защищенное свойство

Array of arguments
protected $args

$bevErr защищенное свойство

protected EventBufferEvent $bevErr
Результат EventBufferEvent

$bevWrite защищенное свойство

protected EventBufferEvent $bevWrite
Результат EventBufferEvent

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

Executable path
public $binPath

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

Chroot
public $chroot

$cmd защищенное свойство

Command string
protected $cmd

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

Chdir
public $cwd

$env защищенное свойство

Hash of environment's variables
protected $env

$errlogfile защищенное свойство

Path to error logfile
protected $errlogfile

$fdWrite защищенное свойство

FD write
protected $fdWrite

$finishWrite защищенное свойство

protected $finishWrite

$nice защищенное свойство

Process priority
protected $nice

$outputErrors защищенное свойство

Output errors?
protected $outputErrors

$pd защищенное свойство

Process descriptor
protected $pd

$pipes защищенное свойство

Opened pipes
protected $pipes

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

SGID
public $setGroup

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

SUID
public $setUser