function backup_migrate_temp_file in Backup and Migrate 5.2
Get a temp file. Store it in the normal save path for slightly better security in shared environments.
7 calls to backup_migrate_temp_file()
- backup_migrate_destination_browser_load in includes/
destinations.browser.inc - Browser upload destination callback.
- backup_migrate_exit in ./
backup_migrate.module - Implementation of hook_exit().
- backup_migrate_file_compress in includes/
files.inc - Compress a file with the given settings. Also updates settings to reflect new file mime and file extension.
- backup_migrate_file_decompress in includes/
files.inc - Decompress a file with the given settings. Also updates settings to reflect new file mime and file extension.
- backup_migrate_perform_backup in ./
backup_migrate.module - Perform a backup with the given settings.
File
- includes/
files.inc, line 128 - General file handling code for Backup and Migrate.
Code
function backup_migrate_temp_file($extension = "", $delete_all = FALSE) {
static $files = array();
if ($delete_all) {
_backup_migrate_temp_files_delete($files);
$files = array();
return;
}
else {
$file = tempnam(file_directory_temp(), 'backup_migrate_');
if (!empty($extension)) {
unlink($file);
$file .= '.' . $extension;
}
$files[] = $file;
return $file;
}
}