PHP Class VersionPress\Utils\Process

Inheritance: extends Symfony\Component\Process\Process
显示文件 Open project: versionpress/versionpress Class Usage Examples

Public Methods

Method Description
__construct ( $commandline, $cwd = null, array $env = null, $input = null, $timeout = 3600, array $options = [] )
addErrorOutput ( $line )
addOutput ( $line )
getConsoleOutput ( ) : string Returns output as it would appear in the console and doesn't care whether it comes from STDOUT or STDERR (or both).
start ( $callback = null )

Method Details

__construct() public method

public __construct ( $commandline, $cwd = null, array $env = null, $input = null, $timeout = 3600, array $options = [] )
$env array
$options array

addErrorOutput() public method

public addErrorOutput ( $line )

addOutput() public method

public addOutput ( $line )

getConsoleOutput() public method

This is useful in client code that just wants to show the user whatever the command printed. The programs will sometimes use STDOUT, sometimes STDERR, sometimes mistakenly STDOUT instead of STDERR etc. but it often doesn't matter, we just want to pass the output on to the user.
public getConsoleOutput ( ) : string
return string

start() public method

public start ( $callback = null )