function drush_sitealias_get_envar_filename

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

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


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/
Read the tmp file where the persistent site setting is stored.
drush_sitealias_site_reset in commands/core/
Deletes the file that stores the DRUPAL_SITE variable for persistent site switching.
drush_sitealias_site_set in commands/core/
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


includes/, line 1987
The site alias API.


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();