You are here

function hosting_site_hosting_install_task_rollback in Hosting 7.4

Same name and namespace in other branches
  1. 5 site/hosting_site.drush.inc \hosting_site_hosting_install_task_rollback()
  2. 6.2 site/hosting_site.drush.inc \hosting_site_hosting_install_task_rollback()
  3. 7.3 site/hosting_site.drush.inc \hosting_site_hosting_install_task_rollback()

Implements the hosting_failed_install hook

File

site/hosting_site.drush.inc, line 169
Drush hooks for the Hosting site module.

Code

function hosting_site_hosting_install_task_rollback($task, $data) {

  // @TODO : we need to check the returned list of errors, not the code.
  if (drush_cmp_error('PROVISION_DRUPAL_SITE_INSTALLED')) {

    // Site has already been installed. Try to import instead.
    drush_log(dt("This site appears to be installed already. Generating an import task."));
    hosting_add_task($task->rid, 'import');
  }
  else {
    $task->ref->no_verify = TRUE;
    $task->ref->site_status = HOSTING_SITE_DISABLED;
    node_save($task->ref);
  }
}