You are here

function _backup_migrate_construct_filename in Backup and Migrate 6.2

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

Construct a filename using token and some cleaning.

2 calls to _backup_migrate_construct_filename()
backup_migrate_perform_backup in ./backup_migrate.module
Perform a backup with the given settings.
_backup_migrate_default_filename in includes/files.inc
Construct a default filename using the site's name.

File

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

Code

function _backup_migrate_construct_filename($filename, $timestamp = '') {
  if (module_exists('token') && function_exists('token_replace')) {
    $filename = token_replace($filename, 'global');
  }
  $filename = preg_replace("/[^a-zA-Z0-9\\.\\-_]/", "", $filename);
  $filename = _backup_migrate_filename_append_prepare($filename, $timestamp);
  $filename .= '-' . $timestamp;
  $filename = trim($filename, '-');
  if (drupal_strlen($filename) == 0) {
    $filename = 'untitled';
  }
  return $filename;
}