public function backup_migrate_destination_email::save_file in Backup and Migrate 7.3
Same name and namespace in other branches
- 8.2 includes/destinations.email.inc \backup_migrate_destination_email::save_file()
- 8.3 includes/destinations.email.inc \backup_migrate_destination_email::save_file()
- 6.3 includes/destinations.email.inc \backup_migrate_destination_email::save_file()
- 6.2 includes/destinations.email.inc \backup_migrate_destination_email::save_file()
- 7.2 includes/destinations.email.inc \backup_migrate_destination_email::save_file()
Save to (ie. email the file) to the email destination.
Overrides backup_migrate_destination::save_file
File
- includes/
destinations.email.inc, line 19 - Functions to handle the email backup destination.
Class
- backup_migrate_destination_email
- A destination for emailing database backups.
Code
public function save_file($file, $settings) {
$size = filesize($file
->filepath());
$max = variable_get('backup_migrate_max_email_size', BACKUP_MIGRATE_MAX_EMAIL_SIZE);
if ($size > $max) {
_backup_migrate_message('Could not email the file @file because it is @size and Backup and Migrate only supports emailing files smaller than @max.', array(
'@file' => $file
->filename(),
'@size' => format_size($size),
'@max' => format_size($max),
), 'error');
return FALSE;
}
$attachment = new stdClass();
$attachment->filename = $file
->filename();
$attachment->path = $file
->filepath();
_backup_migrate_destination_email_mail_backup($attachment, $this
->get_location());
return $file;
}