You are here

public function TempFileManager::create in Backup and Migrate 5.0.x

Create a brand new temp file with the given extension (if specified).

The new file should be writable.

Parameters

string $ext: The file extension for this file (optional)

Return value

BackupFileWritableInterface

Overrides TempFileManagerInterface::create

File

src/Core/File/TempFileManager.php, line 38

Class

TempFileManager
@package Drupal\backup_migrate\Core\Services

Namespace

Drupal\backup_migrate\Core\File

Code

public function create($ext = '') {
  $file = new WritableStreamBackupFile($this->adapter
    ->createTempFile($ext));
  $file
    ->setExtList(explode('.', $ext));
  return $file;
}