function drush_sitealias_add_to_alias_path

8.0.x sitealias.inc drush_sitealias_add_to_alias_path($add_path)
6.x sitealias.inc drush_sitealias_add_to_alias_path($add_path)
7.x sitealias.inc drush_sitealias_add_to_alias_path($add_path)
3.x sitealias.inc drush_sitealias_add_to_alias_path($add_path)
4.x sitealias.inc drush_sitealias_add_to_alias_path($add_path)
5.x sitealias.inc drush_sitealias_add_to_alias_path($add_path)
master sitealias.inc drush_sitealias_add_to_alias_path($add_path)

Add a path to the array of paths where alias files are searched for.

Parameters

$add_path: A path to add to the search path (or NULL to not add any). Once added, the new path will remain available until drush exits.

Return value

An array of paths containing all values added so far

4 calls to drush_sitealias_add_to_alias_path()
drush_sitealias_alias_path in includes/sitealias.inc
Return the array of paths where alias files are searched for.
_drush_find_local_sites_in_sites_folder in includes/sitealias.inc
Return a list of all of the local sites at the specified 'sites' folder.
_drush_sitealias_cache_alias in includes/sitealias.inc
Add an empty record for the specified alias name
_drush_sitealias_get_record in includes/sitealias.inc
This is a continuation of drush_sitealias_get_record, above. It is not intended to be called directly.

File

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

Code

function drush_sitealias_add_to_alias_path($add_path) {
  static $site_paths = array();

  if ($add_path != NULL) {
    if (!is_array($add_path)) {
      $add_path = explode(PATH_SEPARATOR, $add_path);
    }
    // Normalize path to make sure we don't add the same path twice on
    // windows due to different spelling. e.g. c:\tmp and c:/tmp
    foreach ($add_path as &$path) {
      $path = drush_normalize_path($path);
    }
    $site_paths = array_unique(array_merge($site_paths, $add_path));
  }
  return $site_paths;
}