I am trying to determine the best values for temp and files settings for multi-site systems.

TEMP:

Is this a temporary, writable folder? Shouldn't it therefore typically '/tmp' on *nix servers and
($_ENV['TMP']) ? $_ENV['TMP'] : $_ENV['TEMP'];
on Windows servers?

FILES:

On a multi-site system shouldn't this be a separate folder for each site to avoid conflicts like the custom logo for default templates?

Currently I am using the following code in config.php and I want to know if my understanding of these variables is correct.

The actual code I am using is:

// Calculate the part of the table or database name
// if you want to ignore or include different tld or host parts
// add or remove them in the section below
$db_dompart =  preg_replace('/(_org$|_com$|_ca$|_net$|^dev_|^www_|^new_|-)/i',
                             '',
                             strtr(trim(strtolower($_SERVER['HTTP_HOST']),'/'),'./','__'));

/*
 * Set the temp folder based on current environment
 * assumes that if on Windows, TMP or TEMP will be set, if
 * on *nix, session.save_path will be set to any non-standard tmp
 * otherwise it defaults to /tmp
 */
if ($SETTINGS_AUTO_TEMP) { 
  $tmp='/tmp';
  if(isset($_ENV["TMP"])) { $tmp=$_ENV["TMP"]); }
  elseif(isset($_ENV["TEMP"])) { $tmp=$_ENV["TEMP"]); }
  elseif(ini_get('session.save_path')) {
    $tmp=ini_get('session.save_path'); 
  } 
  $conf['file_directory_temp'] => $tmp;
}

/*
 * Set the per-site files folder
 */
if ($SETTINGS_AUTO_FILES) { 
 switch (get_config())
  $conf['file_directory_path'] => 'files/'.$db_dompart;
}

$db_dompart is a domain-based prefix/suffix used to generate table names (or database names depending on the site mode).

Comments

lekei’s picture

Currently I have the above code in settings.php but $SETTINGS_AUTO_TEMP and $SETTINGS_AUTO_FILES are set to FALSE until I know what the advice is