Process

php\lang\Process

Class Process

Methods


__construct($commands, $directory = null, $environment = null)
Parameters:
  • $commandsarray
  • $directorynull, string, php\io\File
  • $environmentarray
start()

throws php\lang\IllegalStateException

Returns:php\lang\Process
startAndWait()

Causes the current thread to wait, if necessary, until the process represented by this Process object has terminated. This method returns immediately if the subprocess has already terminated. If the subprocess has not yet terminated, the calling thread will be blocked until the subprocess exits.

throws php\lang\IllegalStateException

Returns:php\lang\Process
getExitValue()

Returns the exit value for the subprocess.

throws php\lang\IllegalStateException

Returns:int, null - null if process is working
destroy()

Kills the subprocess. The subprocess represented by this Process object is forcibly terminated.

throws php\lang\IllegalStateException

getInput()

Returns the input stream connected to the normal output of the subprocess. The stream obtains data piped from the standard output of the process represented by this Process object.

throws php\lang\IllegalStateException

Returns:php\io\Stream
getOutput()

Returns the output stream connected to the normal input of the subprocess. Output to the stream is piped into the standard input of the process represented by this Process object.

throws php\lang\IllegalStateException

Returns:php\io\Stream
getError()

Returns the input stream connected to the error output of the subprocess. The stream obtains data piped from the error output of the process represented by this Process object.

throws php\lang\IllegalStateException

Returns:php\io\Stream