function _drush_sitealias_print_record

8.0.x sitealias.drush.inc _drush_sitealias_print_record($alias_record, $site_alias = '')
6.x sitealias.drush.inc _drush_sitealias_print_record($alias_record, $site_alias = '')
7.x sitealias.drush.inc _drush_sitealias_print_record($alias_record, $site_alias = '')
3.x sitealias.drush.inc _drush_sitealias_print_record($alias_record, $site_alias = '')
4.x sitealias.drush.inc _drush_sitealias_print_record($alias_record, $site_alias = '')
5.x sitealias.drush.inc _drush_sitealias_print_record($alias_record, $site_alias = '')
master sitealias.drush.inc _drush_sitealias_print_record($alias_record, $site_alias = '')

File

commands/core/sitealias.drush.inc, line 268
Site alias commands.

Code

function _drush_sitealias_print_record($alias_record, $site_alias = '') {
  $result_record = _drush_sitealias_prepare_record($alias_record);

  // The alias name will be the same as the site alias name,
  // unless the user specified some other name on the command line.
  $alias_name = drush_get_option('alias-name');
  if (!isset($alias_name)) {
    $alias_name = $site_alias;
    if (empty($alias_name) || is_numeric($alias_name)) {
      $alias_name = drush_sitealias_uri_to_site_dir($result_record['uri']);
    }
  }

  // Alias names contain an '@' when referenced, but do
  // not contain an '@' when defined.
  if (substr($alias_name, 0, 1) == '@') {
    $alias_name = substr($alias_name, 1);
  }

  $exported_alias = var_export($result_record, TRUE);
  drush_print('$aliases[\'' . $alias_name . '\'] = ' . $exported_alias . ';');
}