You are here

protected function SidecarMetadataDestinationTrait::saveTheFileMetadata in Backup and Migrate 5.0.x

1 call to SidecarMetadataDestinationTrait::saveTheFileMetadata()
DirectoryDestination::saveFile in src/Core/Destination/DirectoryDestination.php
Save a file to the destination.

File

src/Core/Destination/SidecarMetadataDestinationTrait.php, line 39

Class

SidecarMetadataDestinationTrait
Store extended meta data in a sidecar file.

Namespace

Drupal\backup_migrate\Core\Destination

Code

protected function saveTheFileMetadata(BackupFileInterface $file) {

  // Get the file metadata and convert to INI format.
  $meta = $file
    ->getMetaAll();
  $ini = $this
    ->arrayToIni($meta);

  // Create an info file.
  $meta_file = $this
    ->getTempFileManager()
    ->pushExt($file, 'info');
  $meta_file
    ->write($ini);

  // Save the metadata.
  $this
    ->saveTheFile($meta_file);
}