function drush_do_site_command

3.x drush.inc drush_do_site_command($site_record, $command, $args = array(), $data = array(), $integrate = FALSE)
4.x drush.inc drush_do_site_command($site_record, $command, $args = array(), $data = array(), $integrate = FALSE)

Run a command on the site specified by the provided command record.

The standard function that provides this service is called drush_invoke_sitealias_args. Please call the standard function unless you need to set $integrate = TRUE.

Related topics

2 calls to drush_do_site_command()
drush_invoke_sitealias_args in includes/command.inc
Invoke a command in a new process, targeting the site specified by the provided site alias record.
drush_remote_command in includes/drush.inc
Process commands that are executed on a remote drush instance.

File

includes/drush.inc, line 2334
The drush API implementation and helpers.

Code

function drush_do_site_command($site_record, $command, $args = array(), $data = array(), $integrate = FALSE) {
  $values = NULL;
  if (!empty($site_record)) {
    foreach ($site_record as $key => $value) {
      if (!isset($data[$key]) && !in_array($key, drush_sitealias_site_selection_keys())) {
        $data[$key] = $site_record[$key];
      }
    }
    $values = drush_backend_invoke_sitealias($site_record, $command, $args, $data, 'GET', $integrate);
  }
  return $values;
}