function drush_is_local_host

8.0.x drush_is_local_host($host)
6.x drush_is_local_host($host)
7.x drush_is_local_host($host)
3.x drush_is_local_host($host)
4.x drush_is_local_host($host)
5.x drush_is_local_host($host)
master drush_is_local_host($host)

Make a determination whether or not the given host is local or not.


host: A hostname, 'localhost' or ''.

Return value

True if the host is local.

5 calls to drush_is_local_host()
drush_sitealias_evaluate_path in includes/
Evaluate a path from its shorthand form to a literal path usable by rsync.
drush_sitealias_set_alias_context in includes/
Given a site alias record, copy selected fields from it into the drush 'alias' context. The 'alias' context has lower precedence than the 'options' context, so values set by an alias record can be overridden by…
_drush_backend_generate_command in includes/
Generate a command to execute.
_drush_sitealias_preflight_path in includes/
_drush_sql_get_spec_from_options in commands/sql/


includes/, line 1023
Functions used by drush to query the environment and setting the current configuration.


function drush_is_local_host($host) {
  // In order for this to work right, you must use 'localhost' or ''
  // or the machine returned by 'uname -n' for your 'remote-host' entry in
  // your site alias.  Note that sometimes 'uname -n' does not return the
  // correct value.  To fix it, put the correct hostname in /etc/hostname
  // and then run 'hostname -F /etc/hostname'.
  return ($host == 'localhost') || ($host == '') || ($host == php_uname('n'));