You are here

public function DirectoryDestination::saveTheFile in Backup and Migrate 5.0.x

Do the actual file save.

This function is called to save the data file AND the metadata sidecar file.

Parameters

\Drupal\backup_migrate\Core\File\BackupFileReadableInterface $file:

Throws

\Drupal\backup_migrate\Core\Exception\BackupMigrateException

Overrides DestinationBase::saveTheFile

1 call to DirectoryDestination::saveTheFile()
DirectoryDestination::saveFile in src/Core/Destination/DirectoryDestination.php
Save a file to the destination.
1 method overrides DirectoryDestination::saveTheFile()
DrupalDirectoryDestination::saveTheFile in src/Drupal/Destination/DrupalDirectoryDestination.php
Do the actual file save.

File

src/Core/Destination/DirectoryDestination.php, line 67

Class

DirectoryDestination
@package Drupal\backup_migrate\Core\Destination

Namespace

Drupal\backup_migrate\Core\Destination

Code

public function saveTheFile(BackupFileReadableInterface $file) {

  // Check if the directory exists.
  $this
    ->checkDirectory();
  copy($file
    ->realpath(), $this
    ->idToPath($file
    ->getFullName()));

  // @todo Use copy/unlink if the temp file and the destination do not share
  // a stream wrapper.
}