PHP Class Icicle\Concurrent\Process\Process

Inheritance: implements Icicle\Concurrent\ProcessInterface
Exibir arquivo Open project: icicleio/concurrent Class Usage Examples

Public Methods

Method Description
__clone ( ) Resets process values.
__construct ( string $command, string $cwd = '', array $env = [], array $options = [] )
__destruct ( ) Stops the process if it is still running.
getCommand ( ) : string Returns the command to execute.
getEnv ( ) : array Gets the environment variables array.
getOptions ( ) : array Gets the options to pass to proc_open().
getPid ( ) : integer Returns the PID of the child process. Value is only meaningful if the process has been started and PHP was not compiled with --enable-sigchild.
getStdErr ( ) : ReadableStream Gets the process error stream (STDERR).
getStdIn ( ) : WritableStream Gets the process input stream (STDIN).
getStdOut ( ) : ReadableStream Gets the process output stream (STDOUT).
getWorkingDirectory ( ) : string Gets the current working directory.
isRunning ( ) : boolean Determines if the process is still running.
join ( ) : Generator
kill ( )
signal ( integer $signo ) Sends the given signal to the process.
start ( )

Private Methods

Method Description
close ( resource $resource ) Closes the stream resource provided, the open process handle, and stdin.

Method Details

__clone() public method

Resets process values.
public __clone ( )

__construct() public method

public __construct ( string $command, string $cwd = '', array $env = [], array $options = [] )
$command string Command to run.
$cwd string Working directory or use an empty string to use the working directory of the current PHP process.
$env array Environment variables or use an empty array to inherit from the current PHP process.
$options array Options for proc_open().

__destruct() public method

Stops the process if it is still running.
public __destruct ( )

getCommand() public method

Returns the command to execute.
public getCommand ( ) : string
return string The command to execute.

getEnv() public method

Gets the environment variables array.
public getEnv ( ) : array
return array Array of environment variables.

getOptions() public method

Gets the options to pass to proc_open().
public getOptions ( ) : array
return array Array of options.

getPid() public method

Returns the PID of the child process. Value is only meaningful if the process has been started and PHP was not compiled with --enable-sigchild.
public getPid ( ) : integer
return integer

getStdErr() public method

Gets the process error stream (STDERR).
public getStdErr ( ) : ReadableStream
return ReadableStream

getStdIn() public method

Gets the process input stream (STDIN).
public getStdIn ( ) : WritableStream
return WritableStream

getStdOut() public method

Gets the process output stream (STDOUT).
public getStdOut ( ) : ReadableStream
return ReadableStream

getWorkingDirectory() public method

Gets the current working directory.
public getWorkingDirectory ( ) : string
return string The current working directory or null if inherited from the current PHP process.

isRunning() public method

Determines if the process is still running.
public isRunning ( ) : boolean
return boolean

join() public method

public join ( ) : Generator
return Generator

kill() public method

public kill ( )

signal() public method

Sends the given signal to the process.
public signal ( integer $signo )
$signo integer Signal number to send to process.

start() public method

public start ( )