function drush_hosting_alias_pre_hosting_task

7.x-3.x hosting_alias.drush.inc drush_hosting_alias_pre_hosting_task()

File

alias/hosting_alias.drush.inc, line 7
Drush include for the hosting_alias module.

Code

function drush_hosting_alias_pre_hosting_task() {
  if (module_exists('hosting_alias')) {
    $task = &drush_get_context('HOSTING_TASK');
    if ($task->ref->type == 'site') {
      $aliases = implode(',', hosting_alias_get_aliases($task->ref));
      $task->context_options['aliases'] = ($aliases) ? $aliases : 'null';

      $redirection = db_query("SELECT redirection FROM {hosting_site_alias} WHERE vid = :vid", array(':vid' => $task->ref->vid))->fetchField();
      $task->context_options['redirection'] = ($redirection) ? $redirection : 'null';
    }
  }
}