You are here

public function YamlFormSubmissionExporter::writeExportToArchive in YAML Form 8

Write export file to Archive file.

Overrides YamlFormSubmissionExporterInterface::writeExportToArchive

File

src/YamlFormSubmissionExporter.php, line 683

Class

YamlFormSubmissionExporter
Form submission exporter.

Namespace

Drupal\yamlform

Code

public function writeExportToArchive() {
  $export_file_path = $this
    ->getExportFilePath();
  if (file_exists($export_file_path)) {
    $archive_file_path = $this
      ->getArchiveFilePath();
    $archiver = new ArchiveTar($archive_file_path, 'gz');
    $archiver
      ->addModify($export_file_path, $this
      ->getBaseFileName(), $this
      ->getFileTempDirectory());
    @unlink($export_file_path);
  }
}