function drush_sitealias_create_self_alias

8.0.x drush_sitealias_create_self_alias()
6.x drush_sitealias_create_self_alias()
7.x drush_sitealias_create_self_alias()
master drush_sitealias_create_self_alias()

Check to see if a '@self' record was created during bootstrap. If not, make one now.

2 calls to drush_sitealias_create_self_alias()
drush_preflight_site in includes/
_drush_bootstrap_selected_uri in includes/
Find the URI that has been selected by the cwd if it was not previously set via the --uri / -l option


includes/, line 92
The site alias API.


function drush_sitealias_create_self_alias() {
  $self_record = drush_sitealias_get_record('@self');
  if (!array_key_exists('root', $self_record) && !array_key_exists('remote-host', $self_record)) {
    $drupal_root = \Drush::bootstrapManager()->getRoot();
    $uri = drush_get_context('DRUSH_SELECTED_URI');
    if (!empty($drupal_root) && !empty($uri)) {
      // Create an alias '@self'
      _drush_sitealias_cache_alias('@self', array('root' => $drupal_root, 'uri' => $uri));