function _drush_sitealias_find_record_for_local_site

8.0.x _drush_sitealias_find_record_for_local_site($alias, $drupal_root = NULL)
6.x _drush_sitealias_find_record_for_local_site($alias, $drupal_root = null)
7.x _drush_sitealias_find_record_for_local_site($alias, $drupal_root = NULL)
3.x _drush_sitealias_find_record_for_local_site($alias, $drupal_root = null)
4.x _drush_sitealias_find_record_for_local_site($alias, $drupal_root = null)
5.x _drush_sitealias_find_record_for_local_site($alias, $drupal_root = null)
master _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


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()
_drush_sitealias_get_record in includes/
This is a continuation of drush_sitealias_get_record, above. It is not intended to be called directly.


includes/, line 1527
The site alias API.


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_SELECTED_DRUPAL_ROOT');

  if (!empty($drupal_root)) {
    $alias_dir = drush_sitealias_uri_to_site_dir($alias, $drupal_root);
    $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;