ExtraField.php 840 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace PhpZip\Extra;
  3. /**
  4. * Extra Field in a Local or Central Header of a ZIP archive.
  5. * It defines the common properties of all Extra Fields and how to
  6. * serialize/deserialize them to/from byte arrays.
  7. *
  8. * @author Ne-Lexa alexey@nelexa.ru
  9. * @license MIT
  10. */
  11. interface ExtraField
  12. {
  13. /**
  14. * Returns the Header ID (type) of this Extra Field.
  15. * The Header ID is an unsigned short integer (two bytes)
  16. * which must be constant during the life cycle of this object.
  17. *
  18. * @return int
  19. */
  20. public static function getHeaderId();
  21. /**
  22. * Serializes a Data Block.
  23. *
  24. * @return string
  25. */
  26. public function serialize();
  27. /**
  28. * Initializes this Extra Field by deserializing a Data Block.
  29. *
  30. * @param string $data
  31. */
  32. public function deserialize($data);
  33. }