function drush_server_home

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

Return the user's home directory.

6 calls to drush_server_home()
drush_directory_cache in includes/
The path to the global cache directory.
drush_preflight_backup_dir in includes/
Decide where our backup directory should go
_drush_config_file in includes/
Return a list of possible drushrc file locations.
_drush_core_config_php_ini_files in commands/core/
_drush_preflight_alias_path in includes/

... See full list


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


function drush_server_home() {
  // Cannot use $_SERVER superglobal since that's empty during UnitUnishTestCase
  // getenv('HOME') isn't set on Windows and generates a Notice.
  $home = getenv('HOME');
  if (!empty($home)) {
    // home should never end with a trailing slash.
    $home = rtrim($home, '/');
  elseif (!empty($_SERVER['HOMEDRIVE']) && !empty($_SERVER['HOMEPATH'])) {
    // home on windows
    // If HOMEPATH is a root directory the path can end with a slash. Make sure
    // that doesn't happen.
    $home = rtrim($home, '\\/');
  return empty($home) ? NULL : $home;