You are here

function _backup_migrate_temp_file in Backup and Migrate 6

Same name and namespace in other branches
  1. 5 backup_migrate.module \_backup_migrate_temp_file()

Get a temp file. Store it in the normal save path for slightly better security in shared environments.

3 calls to _backup_migrate_temp_file()
_backup_migrate_dump_tables in ./backup_migrate.module
Build the database dump file. Takes a list of tables to exclude and some formatting options.
_backup_migrate_restore_file in ./backup_migrate.module
Restore from a previously backed up files. Accepts any file created by the backup function.
_backup_migrate_send_file_to_download in ./backup_migrate.module
Force a browser download for the file.

File

./backup_migrate.module, line 919
Create (manually or scheduled) and restore backups of your Drupal MySQL database with an option to exclude table data (f.e. cache_*)

Code

function _backup_migrate_temp_file($extension = "", $delete_all = FALSE) {
  static $files = array();
  if ($delete_all) {
    _backup_migrate_temp_files_delete($files);
  }
  else {
    $file = tempnam(file_directory_temp(), 'backup_migrate_');
    if (!empty($extension)) {
      unlink($file);
      $file .= '.' . $extension;
    }
    $files[] = $file;
    return $file;
  }
}