function drush_sitealias_get_envar_filename

8.0.x sitealias.inc drush_sitealias_get_envar_filename($filename_prefix = 'drush-drupal-site-')
6.x sitealias.inc drush_sitealias_get_envar_filename($filename_prefix = 'drush-drupal-site-')
7.x sitealias.inc drush_sitealias_get_envar_filename($filename_prefix = 'drush-drupal-site-')
5.x sitealias.inc drush_sitealias_get_envar_filename($filename_prefix = 'drush-drupal-site-')
master sitealias.inc drush_sitealias_get_envar_filename($filename_prefix = 'drush-drupal-site-')

Returns the filename for the file that stores the DRUPAL_SITE variable.

Parameters

string $filename_prefix: An arbitrary string to prefix the filename with.

Return value

string|false Returns the full path to temp file if possible, or FALSE if not.

4 calls to drush_sitealias_get_envar_filename()
drush_sitealias_site_get in includes/sitealias.inc
Read the tmp file where the persistent site setting is stored.
drush_sitealias_site_reset in commands/core/sitealias.drush.inc
Deletes the file that stores the DRUPAL_SITE variable for persistent site switching.
drush_sitealias_site_set in commands/core/sitealias.drush.inc
Set the DRUPAL_SITE variable by writing it out to a temporary file that we then source for persistent site switching.
siteSetUnitTest::testSiteSet in tests/siteSetUnitTest.php

File

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

Code

function drush_sitealias_get_envar_filename($filename_prefix = 'drush-drupal-site-') {
  if (!function_exists('posix_getppid')) {
    return FALSE;
  }

  $tmp = getenv('TMPDIR') ? getenv('TMPDIR') : '/tmp/';
  return "{$tmp}/drush-env/{$filename_prefix}" . posix_getppid();
}