You are here

function hosting_site_post_hosting_delete_task in Hosting 7.3

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

Implements hook_hosting_post_DELETE().

File

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

Code

function hosting_site_post_hosting_delete_task($task, $data) {
  if ($task->ref->type == 'site') {
    $task->ref->site_status = HOSTING_SITE_DELETED;
    $task->ref->no_verify = TRUE;
    hosting_context_delete($task->ref->nid);
    node_save($task->ref);

    // Record the backup created during delete.
    $task->task_args['description'] = t('Pre-delete backup');
    hosting_site_post_hosting_backup_task($task, $data);

    // Clean up package instances
    hosting_package_instance_sync($task->ref->nid, 'site');
  }
}