PHP Class PHPDaemon\Core\ShellCommand

Author: Vasily Zorin ([email protected])
Inheritance: extends PHPDaemon\Network\IOStream
Afficher le fichier Open project: kakserpom/phpdaemon Class Usage Examples

Méthodes publiques

Свойство Type Description
$binPath Executable path
$chroot Chroot
$cwd Chdir
$setGroup SGID
$setUser SUID

Protected Properties

Свойство Type Description
$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

Méthodes publiques

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

Méthodes protégées

Méthode Description
onRead ( ) : this | null Called when new data received

Method Details

buildArgs() public static méthode

Build arguments string from associative/enumerated array (may be mixed)
public static buildArgs ( array $args ) : string
$args array
Résultat string

close() public méthode

Close the process
public close ( ) : void
Résultat void

closeWrite() public méthode

Close write stream
public closeWrite ( ) : this
Résultat this

eof() public méthode

Got EOF?
public eof ( ) : boolean
Résultat boolean

exec() public static méthode

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() public méthode

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
Résultat this

finishWrite() public méthode

Finish write stream
public finishWrite ( ) : boolean
Résultat boolean

getCmd() public méthode

Get command string
public getCmd ( ) : string
Résultat string

getStatus() public méthode

public getStatus ( )

nice() public méthode

Set priority
public nice ( integer $nice = null ) : this
$nice integer Priority
Résultat this

onEOF() public méthode

Sets callback which will be called once when got EOF
public onEOF ( callable $cb = null ) : this
$cb callable
Résultat this

onEofEvent() public méthode

Called when got EOF
public onEofEvent ( ) : void
Résultat void

onFinish() public méthode

Called when stream is finished
public onFinish ( )

onRead() protected méthode

Called when new data received
protected onRead ( ) : this | null
Résultat this | null

setArgs() public méthode

Sets an array of arguments
public setArgs ( $args = null ) : this
Résultat this

setChroot() public méthode

Set chroot
public setChroot ( string $dir ) : this
$dir string
Résultat this

setCwd() public méthode

Set cwd
public setCwd ( string $dir ) : this
$dir string
Résultat this

setEnv() public méthode

Set a hash of environment's variables
public setEnv ( $env = null ) : this
Résultat this

setFd() public méthode

Sets fd
public setFd ( resource $fd, EventBufferEvent $bev = null ) : void
$fd resource File descriptor
$bev EventBufferEvent
Résultat void

setGroup() public méthode

Set group
public setGroup ( $val ) : this
Résultat this

setUser() public méthode

Set group
public setUser ( string $val ) : this
$val string
Résultat this

write() public méthode

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
Résultat boolean Success

writeln() public méthode

Send data and appending \n to connection. Note that it just writes to buffer flushed at every baseloop
public writeln ( $data ) : boolean
Résultat boolean Success

Property Details

$EOF protected_oe property

Got EOF?
protected $EOF

$args protected_oe property

Array of arguments
protected $args

$bevErr protected_oe property

protected EventBufferEvent $bevErr
Résultat EventBufferEvent

$bevWrite protected_oe property

protected EventBufferEvent $bevWrite
Résultat EventBufferEvent

$binPath public_oe property

Executable path
public $binPath

$chroot public_oe property

Chroot
public $chroot

$cmd protected_oe property

Command string
protected $cmd

$cwd public_oe property

Chdir
public $cwd

$env protected_oe property

Hash of environment's variables
protected $env

$errlogfile protected_oe property

Path to error logfile
protected $errlogfile

$fdWrite protected_oe property

FD write
protected $fdWrite

$finishWrite protected_oe property

protected $finishWrite

$nice protected_oe property

Process priority
protected $nice

$outputErrors protected_oe property

Output errors?
protected $outputErrors

$pd protected_oe property

Process descriptor
protected $pd

$pipes protected_oe property

Opened pipes
protected $pipes

$setGroup public_oe property

SGID
public $setGroup

$setUser public_oe property

SUID
public $setUser