1 backup.config.inc | public BackupConfig::restore(BackupFile $file) |
Restore a backup from a file.
Parameters
BackupFile $file: A BackupFile instance, used to read from the file handle.
Return value
boolean: TRUE if the restore was successful, FALSE on failure.
Overrides Backup::restore
File
- core/
includes/ backup/ backup.config.inc, line 39 - Contains the Backup base class.
Class
- BackupConfig
- Base class for creating backups.
Code
public function restore(BackupFile $file) {
$config_type = $this->getConfigType();
if (!$config_type) {
return FALSE;
}
$config_storage = config_get_config_storage($config_type);
try {
$config_storage->importArchive($file->filePath());
}
catch (ConfigStorageException $e) {
$this->log($e->getMessage(), array(), 'error');
return FALSE;
}
return TRUE;
}