You are here

public function backup_file::temporary_file in Backup and Migrate 7.3

Same name and namespace in other branches
  1. 8.2 includes/files.inc \backup_file::temporary_file()
  2. 8.3 includes/files.inc \backup_file::temporary_file()
  3. 6.3 includes/files.inc \backup_file::temporary_file()
  4. 6.2 includes/files.inc \backup_file::temporary_file()
  5. 7.2 includes/files.inc \backup_file::temporary_file()

Get a temporary file name with path.

3 calls to backup_file::temporary_file()
backup_file::pop_type in includes/files.inc
Push a file extension onto the file and return the previous file path.
backup_file::push_type in includes/files.inc
Push a file extension onto the file and return the previous file path.
backup_file::__construct in includes/files.inc
Construct a file object given a file path, or create a temp file for writing.

File

includes/files.inc, line 560
General file handling code for Backup and Migrate.

Class

backup_file
A backup file which allows for saving to and reading from the server.

Code

public function temporary_file() {
  $file = drupal_tempnam('temporary://', 'backup_migrate_');

  // Add the version without the extension. The tempnam function creates this for us.
  backup_migrate_temp_files_add($file);
  if ($this
    ->extension()) {
    $file .= '.' . $this
      ->extension();

    // Add the version with the extension. This is the one we will actually use.
    backup_migrate_temp_files_add($file);
  }
  $this->path = $file;
}