Page MenuHomePhorge

function exec_manual($cmd, ...)
libphutil Technical Documentation (Futures)

Execute a command and capture stdout, stderr, and the return value.

list ($err, $stdout, $stderr) = exec_manual('ls %s', $file);

When invoking this function, you must manually handle the error condition. Error flows can often be simplified by using execx() instead, which throws an exception when it encounters an error.

Parameters
string$cmdsprintf()-style command pattern to execute.
...Arguments to sprintf pattern.
Return
arrayList of return code, stdout, and stderr.