You are here

interface TempFileManagerInterface in Backup and Migrate 5.0.x

A TempFileManager is in charge of creating new temp files.

.. for writing and tracking all created files so they can be deleted. It is also in charge of copying metadata from one temp file to another as the file gets sent through the chain of plugins.

@package Drupal\backup_migrate\Core\Services

Hierarchy

Expanded class hierarchy of TempFileManagerInterface

All classes that implement TempFileManagerInterface

2 files declare their use of TempFileManagerInterface
FileProcessorInterface.php in src/Core/Plugin/FileProcessorInterface.php
FileProcessorTrait.php in src/Core/Plugin/FileProcessorTrait.php

File

src/Core/File/TempFileManagerInterface.php, line 14

Namespace

Drupal\backup_migrate\Core\File
View source
interface TempFileManagerInterface {

  /**
   * Create a brand new temp file with the given extension (if specified).
   *
   * The new file should be writable.
   *
   * @param string $ext
   *   The file extension for this file (optional)
   *
   * @return \Drupal\backup_migrate\Core\File\BackupFileWritableInterface
   */
  public function create($ext = '');

  /**
   * Return a new file based on the passed in file with the given file ext.
   *
   * This should maintain the metadata of the file passed in with the new file
   * extension added after the old one.
   *
   * For example: xxx.mysql would become xxx.mysql.gz.
   *
   * @param \Drupal\backup_migrate\Core\File\BackupFileInterface $file
   *   The file to add the extension to.
   * @param $ext
   *   The new file extension.
   *
   * @return \Drupal\backup_migrate\Core\File\BackupFileWritableInterface
   *   A new writable backup file with the new extension and all of the metadata
   *   from the previous file.
   */
  public function pushExt(BackupFileInterface $file, $ext);

  /**
   * Return a new file based on the one passed.
   *
   * Has the last part of the file extension removed.
   *
   * For example: xxx.mysql.gz would become xxx.mysql.
   *
   * @param \Drupal\backup_migrate\Core\File\BackupFileInterface $file
   *
   * @return \Drupal\backup_migrate\Core\File\BackupFileWritableInterface
   *   A new writable backup file with the last extension removed and
   *   all of the metadata from the previous file.
   */
  public function popExt(BackupFileInterface $file);

}

Members

Namesort descending Modifiers Type Description Overrides
TempFileManagerInterface::create public function Create a brand new temp file with the given extension (if specified). 1
TempFileManagerInterface::popExt public function Return a new file based on the one passed. 1
TempFileManagerInterface::pushExt public function Return a new file based on the passed in file with the given file ext. 1