function _drush_backend_adjust_options

8.0.x backend.inc _drush_backend_adjust_options($site_record, $command, $command_options, $backend_options)
6.x backend.inc _drush_backend_adjust_options($site_record, $command, $command_options, $backend_options)
7.x backend.inc _drush_backend_adjust_options($site_record, $command, $command_options, $backend_options)
5.x backend.inc _drush_backend_adjust_options($site_record, $command, $command_options, $backend_options)
master backend.inc _drush_backend_adjust_options($site_record, $command, $command_options, $backend_options)

Default options for backend_invoke commands.

1 call to _drush_backend_adjust_options()
drush_backend_invoke_concurrent in includes/backend.inc
Execute a new local or remote command in a new process.

File

includes/backend.inc, line 600
Drush backend API

Code

function _drush_backend_adjust_options($site_record, $command, $command_options, $backend_options) {
  // By default, if the caller does not specify a value for 'output', but does
  // specify 'integrate' === FALSE, then we will set output to FALSE.  Otherwise we
  // will allow it to default to TRUE.
  if ((array_key_exists('integrate', $backend_options)) && ($backend_options['integrate'] === FALSE) && (!array_key_exists('output', $backend_options))) {
    $backend_options['output'] = FALSE;
  }
  $has_site_specification = array_key_exists('root', $site_record) || array_key_exists('uri', $site_record);
  $result = $backend_options + array(
    'method' => 'GET',
    'output' => TRUE,
    'log' => TRUE,
    'integrate' => TRUE,
    'backend' => TRUE,
    'dispatch-using-alias' => !$has_site_specification,
  );
  // Convert '#integrate' et. al. into backend options
  foreach ($command_options as $key => $value) {
    if (substr($key, 0, 1) === '#') {
      $result[substr($key, 1)] = $value;
    }
  }
  return $result;
}