You are here

function backup_file::detect_filetype_from_extension in Backup and Migrate 6.3

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

Get the filetype info of the given file, or false if the file is not a valid type.

2 calls to backup_file::detect_filetype_from_extension()
backup_file::pop_filetype in includes/files.inc
Pop the current file type.
backup_file::set_file_info in includes/files.inc
Set the file info.

File

includes/files.inc, line 530
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 detect_filetype_from_extension() {
  $ext = end($this->ext);
  $this->type = array();
  $types = _backup_migrate_filetypes();
  foreach ($types as $key => $type) {
    if (trim($ext, "_0123456789") === $type['extension']) {
      $this->type = $type;
    }
  }
}