Composer API
Class

Composer\Util\ProcessExecutor

class ProcessExecutor

Methods

__construct(IOInterface $io = null)

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

runs a process on the commandline

splitLines($output)

string getErrorOutput()

Get any error output from the last command

outputHandler($type, $buffer)

static  getTimeout()

static  setTimeout($timeout)

static string escape(string $argument)

Escapes a string to be used as a shell argument.

Details

at line 30
public __construct(IOInterface $io = null)

Parameters

IOInterface $io

at line 44
public 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

at line 79
public splitLines($output)

Parameters

$output

at line 91
public string getErrorOutput()

Get any error output from the last command

Return Value

string

at line 96
public outputHandler($type, $buffer)

Parameters

$type
$buffer

at line 115
static public getTimeout()

at line 120
static public setTimeout($timeout)

Parameters

$timeout

at line 132
static public 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