You are here

function _acquia_migrate_complete in Acquia Connector 6.2

Same name and namespace in other branches
  1. 7.2 acquia_agent/acquia_agent.migrate.inc \_acquia_migrate_complete()

Complete migration tasks.

1 call to _acquia_migrate_complete()
acquia_migrate_batch_finished in acquia_agent/acquia_agent.migrate.inc

File

acquia_agent/acquia_agent.migrate.inc, line 159
Upload to Acquia Cloud.

Code

function _acquia_migrate_complete(&$migration) {

  //$time = timer_stop('acquia_migrate');
  $identifier = acquia_agent_settings('acquia_identifier');
  $key = acquia_agent_settings('acquia_key');
  $body = array(
    'identifier' => acquia_agent_settings('acquia_identifier'),
  );
  if (isset($migration['redirect']) && is_array($migration['redirect']['data'])) {
    $body += $migration['redirect']['data'];
  }
  $data = acquia_agent_call('acquia.agent.cloud.migration.complete', $body, $identifier, $key, variable_get('acquia_spi_server', 'https://nspi.acquia.com'));
  if ($errno = xmlrpc_errno()) {
    acquia_agent_report_xmlrpc_error();
    $migration['error'] = TRUE;
    return;
  }
  elseif (!$data || !isset($data['result'])) {
    $migration['error'] = t("Server error, please submit again.");
    return;
  }

  // Response is in $data['result'].
  $result = $data['result'];
  if ($result['success']) {
    $migration['network_url'] = $result['network_url'];
  }
  else {
    $migration['error'] = $result['error'];
  }
  return $migration;
}