function drush_shell_proc_open

8.0.x drush_shell_proc_open($cmd)
6.x drush_shell_proc_open($cmd)
7.x drush_shell_proc_open($cmd)
5.x drush_shell_proc_open($cmd)
master drush_shell_proc_open($cmd)

Execute bash command using proc_open().

@returns Exit code from launched application 0 no error 1 general error 127 command not found

Related topics

6 calls to drush_shell_proc_open()
drush_core_execute in commands/core/
Command callback. Execute specified shell code. Often used by shell aliases that start with !.
drush_sql_cli in commands/sql/
drush_ssh_site_ssh in commands/core/
Command callback.
_drush_backend_invoke in includes/
Create a new pipe with proc_open, and attempt to parse the output.
_drush_core_execute_cmd in commands/core/
Helper function for drush_core_execute: run one shell command

... See full list


includes/, line 240
Functions for executing system commands. (e.g. exec(), system(), ...).


function drush_shell_proc_open($cmd) {
  if (drush_get_context('DRUSH_VERBOSE') || drush_get_context('DRUSH_SIMULATE')) {
    drush_print("Calling proc_open($cmd);", 0, STDERR);
  if (!drush_get_context('DRUSH_SIMULATE')) {
    $process = proc_open($cmd, array(0 => STDIN, 1 => STDOUT, 2 => STDERR), $pipes);
    $proc_status = proc_get_status($process);
    $exit_code = proc_close($process);
    return ($proc_status["running"] ? $exit_code : $proc_status["exitcode"]);
  return 0;