You are here

function backup_migrate_filter_utils::add_file_info in Backup and Migrate 6.3

Same name and namespace in other branches
  1. 8.2 includes/filters.utils.inc \backup_migrate_filter_utils::add_file_info()
  2. 8.3 includes/filters.utils.inc \backup_migrate_filter_utils::add_file_info()
  3. 7.3 includes/filters.utils.inc \backup_migrate_filter_utils::add_file_info()
  4. 7.2 includes/filters.utils.inc \backup_migrate_filter_utils::add_file_info()

Add the backup metadata to the file.

1 call to backup_migrate_filter_utils::add_file_info()
backup_migrate_filter_utils::post_backup in includes/filters.utils.inc
This function is called immediately post backup.

File

includes/filters.utils.inc, line 165
A filter to run some basic utility functions. Basically any useful option not big enough to justify it's own class.

Class

backup_migrate_filter_utils
A filter to run some basic utility functions.

Code

function add_file_info($file, $settings) {
  $file->file_info['description'] = $settings->filters['utils_description'];
  $file->file_info['datestamp'] = time();
  $file->file_info['generator'] = 'Backup and Migrate (http://drupal.org/project/backup_migrate)';
  $file->file_info['generatorversion'] = BACKUP_MIGRATE_VERSION;
  $file->file_info['siteurl'] = url('', array(
    'absolute' => TRUE,
  ));
  $file->file_info['sitename'] = variable_get('site_name', '');
  $file->file_info['drupalversion'] = VERSION;
  $file
    ->calculate_filesize();
  $source = $settings
    ->get('source');
  $file->file_info['bam_sourceid'] = $source
    ->get('id');
  $file->file_info['bam_sourcetype'] = $source
    ->get('subtype');
  $file->file_info['bam_sourcename'] = $source
    ->get('name');

  // Add any additional info that has been added to the settings by other plugins.
  if (!empty($settings->file_info)) {
    $file->file_info += $settings->file_info;
  }
}