Skip navigation
Help

archiver.inc

  1. drupal
    1. 7 drupal/includes/archiver.inc

Shared classes and interfaces for the archiver system.

Interfaces

NameDescription
ArchiverInterfaceCommon 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. * Common interface for all Archiver classes.
  8. */
  9. interface ArchiverInterface {
  10. /**
  11. * Constructor for 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. * Add 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. * @return ArchiverInterface
  26. * The called object.
  27. */
  28. public function add($file_path);
  29. /**
  30. * Remove the specified file from the archive.
  31. *
  32. * @param $path
  33. * The file name relative to the root of the archive to remove.
  34. * @return ArchiverInterface
  35. * The called object.
  36. */
  37. public function remove($path);
  38. /**
  39. * Extract multiple files in the archive to the specified path.
  40. *
  41. * @param $path
  42. * A full system path of the directory to which to extract files.
  43. * @param $files
  44. * Optionally specify a list of files to be extracted. Files are
  45. * relative to the root of the archive. If not specified, all files
  46. * in the archive will be extracted
  47. * @return ArchiverInterface
  48. * The called object.
  49. */
  50. public function extract($path, Array $files = array());
  51. /**
  52. * List all files in the archive.
  53. *
  54. * @return
  55. * An array of file names relative to the root of the archive.
  56. */
  57. public function listContents();
  58. }