You are here

public function DrupalEncrypt::beforeRestore in Backup and Migrate 8.4

File

src/Filter/DrupalEncrypt.php, line 109

Class

DrupalEncrypt
Class DrupalEncrypt.

Namespace

BackupMigrate\Drupal\Filter

Code

public function beforeRestore(BackupFileReadableInterface $file) {
  $type = $file
    ->getExtLast();
  if ($type == 'ssl' && $this
    ->confGet('encrypt')) {
    $out = $this
      ->getTempFileManager()
      ->popExt($file);
    $success = $this
      ->_decryptFile($file, $out);
    if ($out && $success) {
      return $out;
    }
  }
  return $file;
}