function hosting_site_post_hosting_disable_task in Hosting 7.4
Same name and namespace in other branches
- 5 site/hosting_site.drush.inc \hosting_site_post_hosting_disable_task()
- 6.2 site/hosting_site.drush.inc \hosting_site_post_hosting_disable_task()
- 7.3 site/hosting_site.drush.inc \hosting_site_post_hosting_disable_task()
Implements hook_hosting_post_disable(). I am not very fond of the use of bitwise operators with negatives.
File
- site/
hosting_site.drush.inc, line 187 - Drush hooks for the Hosting site module.
Code
function hosting_site_post_hosting_disable_task($task, $data) {
if ($task->ref->type != 'site') {
return;
}
if ($data['context']['backup_file'] && $data->ref->type == 'site') {
$platform = node_load($task->ref->platform);
hosting_site_add_backup($task->ref->nid, $platform->web_server, $data['context']['backup_file'], t('Generated before being disabled'), $data['context']['backup_file_size']);
}
$task->ref->site_status = HOSTING_SITE_DISABLED;
$task->ref->no_verify = TRUE;
node_save($task->ref);
// Record the backup created during disable.
$task->task_args['description'] = t('Pre-disable backup');
hosting_site_post_hosting_backup_task($task, $data);
}