function _drush_sitealias_find_local_alias_name

8.0.x sitealias.inc _drush_sitealias_find_local_alias_name($root, $uri)
6.x sitealias.inc _drush_sitealias_find_local_alias_name($root, $uri)
7.x sitealias.inc _drush_sitealias_find_local_alias_name($root, $uri)
4.x sitealias.inc _drush_sitealias_find_local_alias_name($root, $uri)
5.x sitealias.inc _drush_sitealias_find_local_alias_name($root, $uri)
master sitealias.inc _drush_sitealias_find_local_alias_name($root, $uri)

Find the name of a local alias record that has the specified root and uri.

File

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

Code

function _drush_sitealias_find_local_alias_name($root, $uri) {
  $result = '';
  $all_site_aliases = &drush_get_context('site-aliases');

  foreach ($all_site_aliases as $alias_name => $alias_values) {
    if (!array_key_exists('remote-host', $alias_values) && array_key_exists('root', $alias_values) && array_key_exists('uri', $alias_values) && ($alias_name != '@self')) {
      if (($root == $alias_values['root']) && ($uri == $alias_values['uri'])) {
        $result = $alias_name;
      }
    }
  }

  return $result;
}