function drush_server_home

8.0.x environment.inc drush_server_home()
6.x environment.inc drush_server_home()
7.x environment.inc drush_server_home()
3.x environment.inc drush_server_home()
4.x environment.inc drush_server_home()
5.x environment.inc drush_server_home()
master environment.inc drush_server_home()

Return the user's home directory.

5 calls to drush_server_home()
drush_directory_cache in includes/environment.inc
The path to the global cache directory.
drush_preflight_backup_dir in includes/filesystem.inc
Decide where our backup directory should go
_drush_bootstrap_base_environment in includes/bootstrap.inc
Sets up basic environment that controls where Drush looks for files on a system-wide basis. Important to call for "early" functions that need to work with unit tests.
_drush_config_file in includes/context.inc
Return a list of possible drushrc file locations.
_drush_core_config_php_ini_files in commands/core/core.drush.inc

File

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

Code

function drush_server_home() {
  // Cannot use $_SERVER superglobal since that's empty during Drush_UnitTestCase
  // getenv('HOME') isn't set on windows and generates a Notice.
  $home = getenv('HOME');
  if (empty($home)) {
    if (!empty($_SERVER['HOMEDRIVE']) && !empty($_SERVER['HOMEPATH'])) {
      // home on windows
      $home = $_SERVER['HOMEDRIVE'] . $_SERVER['HOMEPATH'];
    }
  }
  return empty($home) ? NULL : $home;
}