function drush_sitealias_is_remote_site

8.0.x sitealias.inc drush_sitealias_is_remote_site($alias)
6.x sitealias.inc drush_sitealias_is_remote_site($alias)
7.x sitealias.inc drush_sitealias_is_remote_site($alias)
master sitealias.inc drush_sitealias_is_remote_site($alias)

Determines whether a given site alias is for a remote site.

Parameters

string $alias: An alias name or site specification.

Return value

bool Returns TRUE if the alias refer to a remote site, or FALSE if it does not.

2 calls to drush_sitealias_is_remote_site()
drush_browse in commands/core/browse.drush.inc
Command callback.
drush_user_login in commands/user/user.drush.inc
Displays a one time login link for the given user.

File

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

Code

function drush_sitealias_is_remote_site($alias) {
  if (!is_string($alias) || !strlen($alias)) {
    return FALSE;
  }

  $site_record = drush_sitealias_get_record($alias);
  if ($site_record) {
    if (!empty($site_record['remote-host'])) {
      return TRUE;
    }
  }
  else {
    drush_set_error('Unrecognized site alias.');
  }

  return FALSE;
}