class ProcessExecutor (View source)

Properties

static protected $timeout
protected $captureOutput
protected $errorOutput
protected $io

Methods

__construct(IOInterface $io = null)

No description

int
execute(string $command, mixed $output = null, string $cwd = null)

runs a process on the commandline

splitLines($output)

No description

string
getErrorOutput()

Get any error output from the last command

outputHandler($type, $buffer)

No description

static 
getTimeout()

No description

static 
setTimeout($timeout)

No description

static string
escape(string $argument)

Escapes a string to be used as a shell argument.

Details

__construct(IOInterface $io = null)

Parameters

IOInterface $io

int execute(string $command, mixed $output = null, string $cwd = null)

runs a process on the commandline

Parameters

string $command the command to execute
mixed $output the output will be written into this var if passed by ref if a callable is passed it will be used as output handler
string $cwd the working directory

Return Value

int statuscode

splitLines($output)

Parameters

$output

string getErrorOutput()

Get any error output from the last command

Return Value

string

outputHandler($type, $buffer)

Parameters

$type
$buffer

static getTimeout()

static setTimeout($timeout)

Parameters

$timeout

static string escape(string $argument)

Escapes a string to be used as a shell argument.

Parameters

string $argument The argument that will be escaped

Return Value

string The escaped argument