You are here

function drush_hosting_site_pre_hosting_task in Hosting 6.2

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

Map values of site node into command line arguments

File

site/hosting_site.drush.inc, line 51

Code

function drush_hosting_site_pre_hosting_task($task) {
  $task =& drush_get_context('HOSTING_TASK');
  if ($task->task_type == 'restore') {
    $backup = hosting_site_get_backup($task->task_args['bid']);
    $task->args[1] = $backup['filename'];
  }
  if ($task->task_type == 'backup-delete') {
    foreach ($task->task_args as $bid => $filename) {
      if ($filename !== '0') {
        $backups[] = $filename;
      }
    }
    $task->args[1] = implode(',', $backups);
  }
}