You are here

function backup_file::set_file_info in Backup and Migrate 6.2

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

Set the file info.

2 calls to backup_file::set_file_info()
backup_file::backup_file in includes/files.inc
Construct a file object given a file path, or create a temp file for writing.
backup_file::set_filepath in includes/files.inc
Set the current filepath.

File

includes/files.inc, line 414
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

function set_file_info($file_info) {
  $this->file_info = $file_info;
  $this->ext = explode('.', @$this->file_info['filename']);

  // Remove the underscores added to file extensions by Drupal's upload security.
  foreach ($this->ext as $key => $val) {
    $this->ext[$key] = trim($val, '_');
  }
  $this
    ->filename(array_shift($this->ext));
  $this
    ->detect_filetype_from_extension();
}