function drush_hosting_site_pre_hosting_task

7.x-3.x hosting_site.drush.inc drush_hosting_site_pre_hosting_task($task)

Map values of site node into command line arguments

File

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

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);
  }

}