EndOfCentralDirectory.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <?php
  2. namespace PhpZip\Model;
  3. /**
  4. * End of Central Directory.
  5. *
  6. * @author Ne-Lexa alexey@nelexa.ru
  7. * @license MIT
  8. */
  9. class EndOfCentralDirectory
  10. {
  11. /** @var int Count files. */
  12. private $entryCount;
  13. /** @var int Central Directory Offset. */
  14. private $cdOffset;
  15. /** @var int */
  16. private $cdSize;
  17. /** @var string|null The archive comment. */
  18. private $comment;
  19. /** @var bool Zip64 extension */
  20. private $zip64;
  21. /**
  22. * EndOfCentralDirectory constructor.
  23. *
  24. * @param int $entryCount
  25. * @param int $cdOffset
  26. * @param int $cdSize
  27. * @param bool $zip64
  28. * @param string|null $comment
  29. */
  30. public function __construct($entryCount, $cdOffset, $cdSize, $zip64, $comment = null)
  31. {
  32. $this->entryCount = $entryCount;
  33. $this->cdOffset = $cdOffset;
  34. $this->cdSize = $cdSize;
  35. $this->zip64 = $zip64;
  36. $this->comment = $comment;
  37. }
  38. /**
  39. * @param string|null $comment
  40. */
  41. public function setComment($comment)
  42. {
  43. $this->comment = $comment;
  44. }
  45. /**
  46. * @return int
  47. */
  48. public function getEntryCount()
  49. {
  50. return $this->entryCount;
  51. }
  52. /**
  53. * @return int
  54. */
  55. public function getCdOffset()
  56. {
  57. return $this->cdOffset;
  58. }
  59. /**
  60. * @return int
  61. */
  62. public function getCdSize()
  63. {
  64. return $this->cdSize;
  65. }
  66. /**
  67. * @return string|null
  68. */
  69. public function getComment()
  70. {
  71. return $this->comment;
  72. }
  73. /**
  74. * @return bool
  75. */
  76. public function isZip64()
  77. {
  78. return $this->zip64;
  79. }
  80. }