You are here

function drush_content_synchronizer_clean_temporary_files in Content Synchronizer 8.2

Same name and namespace in other branches
  1. 8 content_synchronizer.drush.inc \drush_content_synchronizer_clean_temporary_files()

Delete temporary files.

File

./content_synchronizer.drush.inc, line 96
Drush commands for content_synchronizer module.

Code

function drush_content_synchronizer_clean_temporary_files() {
  $path = \Drupal::service('file_system')
    ->realpath(ExportEntityWriter::GENERATOR_DIR);

  /** @var \Drupal\Core\File\FileSystemInterface $fileSystem */
  $fileSystem = \Drupal::service('file_system');
  foreach (glob($path . '/*') as $file) {
    if (is_dir($file)) {
      $fileSystem
        ->deleteRecursive($file);
    }
  }
}