Page MenuHomePhorge

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

Execute a command and capture stdout and stderr. If the command exits with a nonzero error code, a CommandException will be thrown. If you need to manually handle error conditions, use exec_manual().

list ($stdout, $stderr) = execx('ls %s', $file);
Parameters
string$cmdsprintf()-style command pattern to execute.
...Arguments to sprintf pattern.
Return
arrayList of stdout and stderr.