You are here

function drush_hosting_task_provision_save in Hosting 7.4

Helper to just run provision-save

File

./task.hosting.inc, line 531
Drush include for the Hosting module's hosting task command.

Code

function drush_hosting_task_provision_save($hosting_name, $context_options, $message = NULL) {

  /*
  // Build command as an array for compatibility.
  $command = array(
    "drush",
    "provision-save",
    "@{$hosting_name}",
  );

  // Prepare "context_options" by converting them to command line options.
  foreach ($context_options as $name => $value) {
    if (!is_string($value)) {
      continue;
    }

    // Keep empty values here because it's being saved to context.
    // If values don't exist here, the existing drush context properties will remain unchanged.
    $value = escapeshellarg($value);
    $command[] = "--{$name}={$value}";
  }

  // Run the process using "drush_log" to present output.
  // "drush_log then saves each line to the front-end database.
  // @TODO: Leaving legacy provision in place for this PR.
  $message = $message?: t('Saving metadata...');
  hosting_process($command, null, t($message));
  */
  $mode = drush_get_option('debug', FALSE) ? 'GET' : 'POST';
  drush_invoke_process('@none', 'provision-save', array(
    '@' . $hosting_name,
  ), $context_options, array(
    'method' => $mode,
    'integrate' => TRUE,
  ));

  // hosting_process($command, null, t($message));
}