You are here

protected function DrupalEncrypt::_decryptFile in Backup and Migrate 8.4

1 call to DrupalEncrypt::_decryptFile()
DrupalEncrypt::beforeRestore in src/Filter/DrupalEncrypt.php

File

src/Filter/DrupalEncrypt.php, line 90

Class

DrupalEncrypt
Class DrupalEncrypt.

Namespace

BackupMigrate\Drupal\Filter

Code

protected function _decryptFile(BackupFileReadableInterface $from, BackupFileWritableInterface $to) {
  $path = drupal_realpath($from
    ->realpath());
  $out_path = drupal_realpath($to
    ->realpath());
  try {
    CryptoFile::decryptFileWithPassword($path, $out_path, $this
      ->confGet('encrypt_password'));
    return TRUE;
  } catch (Exception $e) {
    return FALSE;
  }
}