function drush_sitealias_get_path_option

8.0.x sitealias.inc drush_sitealias_get_path_option($site_alias_record, $option, $default = NULL)
6.x sitealias.inc drush_sitealias_get_path_option($site_alias_record, $option, $default = NULL)
7.x sitealias.inc drush_sitealias_get_path_option($site_alias_record, $option, $default = NULL)
5.x sitealias.inc drush_sitealias_get_path_option($site_alias_record, $option, $default = NULL)
master sitealias.inc drush_sitealias_get_path_option($site_alias_record, $option, $default = NULL)

First return an option set via drush_sitealias_overlay_options, if any, then fall back on "%" . $option from the path aliases.

File

includes/sitealias.inc, line 1750
The site alias API.

Code

function drush_sitealias_get_path_option($site_alias_record, $option, $default = NULL) {
  if (isset($site_alias_record) && array_key_exists($option, $site_alias_record)) {
    return $site_alias_record[$option];
  }
  if (isset($site_alias_record) && array_key_exists('path-aliases', $site_alias_record) && array_key_exists("%$option", $site_alias_record['path-aliases'])) {
    return $site_alias_record['path-aliases']["%$option"];
  }
  else {
    return drush_get_option($option, $default);
  }
}