1 backup.database.inc | public BackupDatabase::preRestore(BackupFile &$file) |
Prepare a file for restoration.
This step is usually utilized to decompress a backup file.
Parameters
BackupFile $file: The file containing the backup to be restored. This is explicitly passed by reference to allow it to be reassigned to a new file if needed.
Return value
void:
Overrides Backup::preRestore
File
- core/
includes/ backup/ backup.database.inc, line 263 - Functions to handle the direct to/from database backup source.
Class
- BackupDatabase
- A destination type for saving to a database server.
Code
public function preRestore(BackupFile &$file) {
parent::preRestore($file);
// Decompress the backup but leave the original file.
if ($file->lastExtension() === 'gz') {
$this->decompress($file, self::COMPRESSION_GZIP, FALSE);
$file->popExtension();
}
}