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 refers to a remote site, FALSE if it does not, or NULL is unsure.

6 calls to drush_sitealias_is_remote_site()
BrowseCommands::browse in lib/Drush/CommandFiles/core/BrowseCommands.php
Display a link to a given path or open link in a browser.
drush_core_rsync in commands/core/rsync.core.inc
A command callback.
drush_get_runner in includes/sitealias.inc
Decide on which side to run a core-rsync.
drush_sitealias_evaluate_path in includes/sitealias.inc
Evaluate a path from its shorthand form to a literal path usable by rsync.
drush_ssh_site_ssh in commands/core/ssh.drush.inc
Command callback.

... See full list

File

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

Code

function drush_sitealias_is_remote_site($alias) {
  if (is_array($alias) && !empty($alias['remote-host'])) {
    return TRUE;
  }
  if (!is_string($alias) || !strlen($alias)) {
    return NULL;
  }

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