ZipOptions.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. namespace PhpZip\Constants;
  3. use PhpZip\IO\ZipReader;
  4. use PhpZip\ZipFile;
  5. /**
  6. * Interface ZipOptions.
  7. */
  8. interface ZipOptions
  9. {
  10. /**
  11. * Boolean option for store just file names (skip directory names).
  12. *
  13. * @see ZipFile::addFromFinder()
  14. */
  15. const STORE_ONLY_FILES = 'only_files';
  16. /**
  17. * Uses the specified compression method.
  18. *
  19. * @see ZipFile::addFromFinder()
  20. * @see ZipFile::addSplFile()
  21. */
  22. const COMPRESSION_METHOD = 'compression_method';
  23. /**
  24. * Set the specified record modification time.
  25. * The value can be {@see \DateTimeInterface}, integer timestamp
  26. * or a string of any format.
  27. *
  28. * @see ZipFile::addFromFinder()
  29. * @see ZipFile::addSplFile()
  30. */
  31. const MODIFIED_TIME = 'mtime';
  32. /**
  33. * Specifies the encoding of the record name for cases when the UTF-8
  34. * usage flag is not set.
  35. *
  36. * The most commonly used encodings are compiled into the constants
  37. * of the {@see DosCodePage} class.
  38. *
  39. * @see ZipFile::openFile()
  40. * @see ZipFile::openFromString()
  41. * @see ZipFile::openFromStream()
  42. * @see ZipReader::getDefaultOptions()
  43. * @see DosCodePage::getCodePages()
  44. */
  45. const CHARSET = 'charset';
  46. /**
  47. * Allows ({@see true}) or denies ({@see false}) unpacking unix symlinks.
  48. *
  49. * This is a potentially dangerous operation for uncontrolled zip files.
  50. * By default is ({@see false}).
  51. *
  52. * @see https://josipfranjkovic.blogspot.com/2014/12/reading-local-files-from-facebooks.html
  53. */
  54. const EXTRACT_SYMLINKS = 'extract_symlinks';
  55. }