You are here

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

File

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

Class

SidecarMetadataDestinationTrait
Store extended meta data in a sidecar file.

Namespace

Drupal\backup_migrate\Core\Destination

Code

protected function loadFileMetadataArray(BackupFileInterface $file) {
  $info = [];
  $id = $file
    ->getFullName();
  $filename = $id . '.info';
  if ($this
    ->fileExists($filename)) {
    $meta_file = $this
      ->getFile($filename);
    $meta_file = $this
      ->loadFileForReading($meta_file);
    $info = $this
      ->iniToArray($meta_file
      ->readAll());
  }
  return $info;
}