You are here

function DrupalDirectoryDestination::_saveFile in Backup and Migrate 8.4

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

Parameters

\BackupMigrate\Core\File\BackupFileReadableInterface $file:

Throws

\BackupMigrate\Core\Exception\BackupMigrateException

Overrides DirectoryDestination::_saveFile

File

src/Destination/DrupalDirectoryDestination.php, line 27

Class

DrupalDirectoryDestination
Class DrupalDirectoryDestination.

Namespace

BackupMigrate\Drupal\Destination

Code

function _saveFile(BackupFileReadableInterface $file) {

  // Check if the directory exists.
  $this
    ->checkDirectory();

  // @TODO Decide what the appropriate file_exists strategy should be.
  file_unmanaged_move($file
    ->realpath(), $this
    ->_idToPath($file
    ->getFullName()), FILE_EXISTS_REPLACE);
}