archiver.inc

Shared classes and interfaces for the archiver system.

Interfaces

Namesort descending Description
ArchiverInterface Defines the common interface for all Archiver classes.

File

drupal/includes/archiver.inc
View source
  1. <?php
  2. /**
  3. * @file
  4. * Shared classes and interfaces for the archiver system.
  5. */
  6. /**
  7. * Defines the common interface for all Archiver classes.
  8. */
  9. interface ArchiverInterface {
  10. /**
  11. * Constructs a new archiver instance.
  12. *
  13. * @param $file_path
  14. * The full system path of the archive to manipulate. Only local files
  15. * are supported. If the file does not yet exist, it will be created if
  16. * appropriate.
  17. */
  18. public function __construct($file_path);
  19. /**
  20. * Adds the specified file or directory to the archive.
  21. *
  22. * @param $file_path
  23. * The full system path of the file or directory to add. Only local files
  24. * and directories are supported.
  25. *
  26. * @return ArchiverInterface
  27. * The called object.
  28. */
  29. public function add($file_path);
  30. /**
  31. * Removes the specified file from the archive.
  32. *
  33. * @param $path
  34. * The file name relative to the root of the archive to remove.
  35. *
  36. * @return ArchiverInterface
  37. * The called object.
  38. */
  39. public function remove($path);
  40. /**
  41. * Extracts multiple files in the archive to the specified path.
  42. *
  43. * @param $path
  44. * A full system path of the directory to which to extract files.
  45. * @param $files
  46. * Optionally specify a list of files to be extracted. Files are
  47. * relative to the root of the archive. If not specified, all files
  48. * in the archive will be extracted.
  49. *
  50. * @return ArchiverInterface
  51. * The called object.
  52. */
  53. public function extract($path, array $files = array());
  54. /**
  55. * Lists all files in the archive.
  56. *
  57. * @return
  58. * An array of file names relative to the root of the archive.
  59. */
  60. public function listContents();
  61. }