You are here

public function ContentSynchronizerCommands::synchronizerCleanTemporaryFiles in Content Synchronizer 8

Same name and namespace in other branches
  1. 8.2 src/Commands/ContentSynchronizerCommands.php \Drupal\content_synchronizer\Commands\ContentSynchronizerCommands::synchronizerCleanTemporaryFiles()

Delete temporary files.

@command content:synchronizer-clean-temporary-files @aliases csctf,content-synchronizer-clean-temporary-files

File

src/Commands/ContentSynchronizerCommands.php, line 82

Class

ContentSynchronizerCommands
A Drush commandfile.

Namespace

Drupal\content_synchronizer\Commands

Code

public function synchronizerCleanTemporaryFiles() {
  $path = \Drupal::service('file_system')
    ->realpath(ExportEntityWriter::GENERATOR_DIR);
  foreach (glob($path . '/*') as $file) {
    if (is_dir($file)) {
      file_unmanaged_delete_recursive($file);
    }
  }
}