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)

Related topics

5 calls to drush_do_site_command()
drush_remote_command in includes/drush.inc
Process commands that are executed on a remote drush instance.
drush_sitealias_add_db_settings in includes/sitealias.inc
If the alias record does not contain a 'databases' or 'db-url' entry, then use backend invoke to look up the settings value from the remote or local site. The 'databases' form is preferred; 'db_url' will be…
drush_sitealias_add_db_url in includes/sitealias.inc
If the alias record does not contain a 'databases' or 'db-url' entry, then use backend invoke to look up the settings value from the remote or local site. The 'db_url' form is preferred; nothing is done if…
drush_sitealias_resolve_path_references in includes/sitealias.inc
If there are any path aliases (items beginning with "%") in the test string, then resolve them as path aliases and add them to the provided alias record.
drush_upgrade_site_upgrade in commands/core/upgrade.drush.inc
A drush command callback.

File

includes/drush.inc, line 1239
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];
      }
    }

    $drush_path = NULL;
    if (array_key_exists('path-aliases', $site_record)) {
      if (array_key_exists('%drush-script', $site_record['path-aliases'])) {
        $drush_path = $site_record['path-aliases']['%drush-script'];
      }
    }
    $values = drush_backend_invoke_args($command, $args, $data, 'GET', $integrate, $drush_path, array_key_exists('remote-host', $site_record) ? $site_record['remote-host'] : NULL, array_key_exists('remote-user', $site_record) ? $site_record['remote-user'] : NULL, array_key_exists('ssh-options', $site_record) ? $site_record['ssh-options'] : NULL);
  }
  return $values;
}