function drush_invoke_process

8.0.x command.inc drush_invoke_process($site_alias_record, $command_name, $commandline_args = array(), $commandline_options = array(), $backend_options = TRUE)
6.x command.inc drush_invoke_process($site_alias_record, $command_name, $commandline_args = array(), $commandline_options = array(), $backend_options = TRUE)
7.x command.inc drush_invoke_process($site_alias_record, $command_name, $commandline_args = array(), $commandline_options = array(), $backend_options = TRUE)
4.x command.inc drush_invoke_process($site_alias_record /*, $command_name, $commandline_args = array(), $commandline_options = array(), $backend_options = array() */)
5.x command.inc drush_invoke_process($site_alias_record, $command_name, $commandline_args = array(), $commandline_options = array(), $backend_options = TRUE)
master command.inc drush_invoke_process($site_alias_record, $command_name, $commandline_args = array(), $commandline_options = array(), $backend_options = TRUE)

Invoke a command in a new process, targeting the site specified by the provided site alias record.

Parameters

array $site_alias_record: The site record to execute the command on.

string $command_name: The command to invoke.

array $commandline_args: The arguments to pass to the command.

array $commandline_options: The options (e.g. --select) to provide to the command.

Return value

If the command could not be completed successfully, FALSE. If the command was completed, this will return an associative array containing the results of the API call. @see drush_backend_get_result()

This function may also be called via its deprecated function signature (drush-3.x compatible): drush_invoke_process($command_name, $arg1, $arg2, ...); Instead of this old form, prefer: drush_invoke_process("@self", $command_name, array($arg1, $arg2, ...));

Related topics

2 calls to drush_invoke_process()
drush_pm_enable_validate in commands/pm/pm.drush.inc
Validate callback. Determine the modules and themes that the user would like enabled.
drush_upgrade_site_upgrade in commands/core/upgrade.drush.inc
Main command hook for site-upgrade.

File

includes/command.inc, line 267
The drush command engine.

Code

function drush_invoke_process($site_alias_record /*, $command_name, $commandline_args = array(), $commandline_options = array(), $backend_options = array() */) {
  if (is_array($site_alias_record) || ($site_alias_record[0] == '@')) {
    $args = func_get_args();
    array_shift($args);
    $command_name = array_shift($args);
    $commandline_args = empty($args) ? array() : array_shift($args);
    $commandline_options = empty($args) ? array() : array_shift($args);
    // Forwards-compatibility with drush_invoke_process in Drush-5.x.
    $backend_options = empty($args) ? array() : array_shift($args);
    foreach ($backend_options as $key => $value) {
      $commandline_options['#' . $key] = $value;
    }
    $integrate = TRUE;
    return drush_invoke_sitealias_args($site_alias_record, $command_name, $commandline_args, $commandline_options, $integrate);
  }
  else {
    $args = func_get_args();
    $command_name = array_shift($args);
    return drush_invoke_process_args($command_name, $args);
  }
}