3 namespace Drupal\Core\Archiver;
6 * Defines the common interface for all Archiver classes.
8 * @see \Drupal\Core\Archiver\ArchiverManager
9 * @see \Drupal\Core\Archiver\Annotation\Archiver
12 interface ArchiverInterface {
15 * Adds the specified file or directory to the archive.
17 * @param string $file_path
18 * The full system path of the file or directory to add. Only local files
19 * and directories are supported.
21 * @return \Drupal\Core\Archiver\ArchiverInterface
24 public function add($file_path);
27 * Removes the specified file from the archive.
30 * The file name relative to the root of the archive to remove.
32 * @return \Drupal\Core\Archiver\ArchiverInterface
35 public function remove($path);
38 * Extracts multiple files in the archive to the specified path.
41 * A full system path of the directory to which to extract files.
43 * Optionally specify a list of files to be extracted. Files are
44 * relative to the root of the archive. If not specified, all files
45 * in the archive will be extracted.
47 * @return \Drupal\Core\Archiver\ArchiverInterface
50 public function extract($path, array $files = []);
53 * Lists all files in the archive.
56 * An array of file names relative to the root of the archive.
58 public function listContents();