You are here

protected function FileProcessor::addFileToAssets in Content Synchronizer 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/content_synchronizer/entity_processor/FileProcessor.php \Drupal\content_synchronizer\Plugin\content_synchronizer\entity_processor\FileProcessor::addFileToAssets()
  2. 3.x src/Plugin/content_synchronizer/entity_processor/FileProcessor.php \Drupal\content_synchronizer\Plugin\content_synchronizer\entity_processor\FileProcessor::addFileToAssets()

Add file to assets dir.

1 call to FileProcessor::addFileToAssets()
FileProcessor::getDataToExport in src/Plugin/content_synchronizer/entity_processor/FileProcessor.php
Return the data to export.

File

src/Plugin/content_synchronizer/entity_processor/FileProcessor.php, line 40

Class

FileProcessor
Plugin implementation of the 'accordion' formatter.

Namespace

Drupal\content_synchronizer\Plugin\content_synchronizer\entity_processor

Code

protected function addFileToAssets(File $file) {
  $assetsDir = $this
    ->getExportAssetsDir();
  $destination = $this
    ->createDirTreeForFileDest(str_replace('://', '/', $file
    ->getFileUri()), $assetsDir);

  // Copy file in destination directory.
  file_copy($file, $destination);
}