function _drush_sitealias_find_record_for_local_site

8.0.x sitealias.inc _drush_sitealias_find_record_for_local_site($alias, $drupal_root = NULL)
6.x sitealias.inc _drush_sitealias_find_record_for_local_site($alias, $drupal_root = null)
7.x sitealias.inc _drush_sitealias_find_record_for_local_site($alias, $drupal_root = NULL)
3.x sitealias.inc _drush_sitealias_find_record_for_local_site($alias, $drupal_root = null)
4.x sitealias.inc _drush_sitealias_find_record_for_local_site($alias, $drupal_root = null)
5.x sitealias.inc _drush_sitealias_find_record_for_local_site($alias, $drupal_root = null)
master sitealias.inc _drush_sitealias_find_record_for_local_site($alias, $drupal_root = NULL)

If '$alias' is the name of a folder in the sites folder of the given drupal root, then build an alias record for it

Parameters

alias: The name of the site in the 'sites' folder to convert

Return value

array An alias record, or empty if none found.

1 call to _drush_sitealias_find_record_for_local_site()

File

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

Code

function _drush_sitealias_find_record_for_local_site($alias, $drupal_root = null) {
  $alias_record = array();

  // Clip off the leading '#' if it is there
  if (substr($alias, 0, 1) == '#') {
    $alias = substr($alias, 1);
  }

  if (!isset($drupal_root)) {
    //$drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT');
    $drupal_root = drush_get_option(array('r', 'root'), drush_locate_root());
  }

  if (isset($drupal_root)) {
    $alias_dir = drush_sitealias_uri_to_site_dir($alias);
    $site_settings_file = $drupal_root . '/sites/' . $alias_dir . '/settings.php';
    $alias_record = drush_sitealias_build_record_from_settings_file($site_settings_file, $alias, $drupal_root);
  }

  return $alias_record;
}