function drush_sitealias_alias_path

8.0.x sitealias.inc drush_sitealias_alias_path($alias_path_context = NULL)
6.x sitealias.inc drush_sitealias_alias_path($alias_path_context = NULL)
7.x sitealias.inc drush_sitealias_alias_path($alias_path_context = NULL)
3.x sitealias.inc drush_sitealias_alias_path($alias_path_context = NULL)
4.x sitealias.inc drush_sitealias_alias_path($alias_path_context = NULL)
5.x sitealias.inc drush_sitealias_alias_path($alias_path_context = NULL)
master sitealias.inc drush_sitealias_alias_path($alias_path_context = NULL)

Return the array of paths where alias files are searched for.

Parameters

$alias_path_context: If the alias being looked up is part of a relative alias, the alias path context specifies the context of the primary alias the new alias is rooted from. Alias files stored in the sites folder of this context, or inside the context itself takes priority over any other search path that might define a similarly-named alias. In this way, multiple sites can define a '@peer' alias.

Return value

An array of paths

1 call to drush_sitealias_alias_path()
_drush_sitealias_find_alias_files in includes/sitealias.inc
Function to find all alias files that might contain aliases that match the requested alias name.

File

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

Code

function drush_sitealias_alias_path($alias_path_context = NULL) {
  $context_path = array();
  if (isset($alias_path_context)) {
    $context_path = array(drush_sitealias_local_site_path($alias_path_context));
  }
  // We get the current list of site paths by adding NULL
  // (nothing) to the path list, which is a no-op
  $site_paths = drush_sitealias_add_to_alias_path(NULL);

  // If the user defined the root of a drupal site, then also
  // look for alias files in /drush and /sites/all/drush.
  $drupal_root = drush_get_context('DRUSH_SELECTED_DRUPAL_ROOT');
  if (isset($drupal_root)) {
    $site_paths[] = $drupal_root . '/drush';
    $site_paths[] = $drupal_root . '/sites/all/drush';
  }
  $alias_path = (array) drush_get_context('ALIAS_PATH', array());
  return array_unique(array_merge($context_path, $alias_path, $site_paths));
}