php_zip.stub.php 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. <?php
  2. /** @generate-class-entries */
  3. /**
  4. * @return resource|int|false
  5. * @deprecated
  6. */
  7. function zip_open(string $filename) {}
  8. /**
  9. * @param resource $zip
  10. * @deprecated
  11. */
  12. function zip_close($zip): void {}
  13. /**
  14. * @param resource $zip
  15. * @return resource|false
  16. * @deprecated
  17. */
  18. function zip_read($zip) {}
  19. /**
  20. * @param resource $zip_dp
  21. * @param resource $zip_entry
  22. * @deprecated
  23. */
  24. function zip_entry_open($zip_dp, $zip_entry, string $mode = "rb"): bool {}
  25. /**
  26. * @param resource $zip_entry
  27. * @deprecated
  28. */
  29. function zip_entry_close($zip_entry): bool {}
  30. /**
  31. * @param resource $zip_entry
  32. * @deprecated
  33. */
  34. function zip_entry_read($zip_entry, int $len = 1024): string|false {}
  35. /**
  36. * @param resource $zip_entry
  37. * @deprecated
  38. */
  39. function zip_entry_name($zip_entry): string|false {}
  40. /**
  41. * @param resource $zip_entry
  42. * @deprecated
  43. */
  44. function zip_entry_compressedsize($zip_entry): int|false {}
  45. /**
  46. * @param resource $zip_entry
  47. * @deprecated
  48. */
  49. function zip_entry_filesize($zip_entry): int|false {}
  50. /**
  51. * @param resource $zip_entry
  52. * @deprecated
  53. */
  54. function zip_entry_compressionmethod($zip_entry): string|false {}
  55. class ZipArchive implements Countable
  56. {
  57. /** @readonly */
  58. public int $lastId;
  59. /** @readonly */
  60. public int $status;
  61. /** @readonly */
  62. public int $statusSys;
  63. /** @readonly */
  64. public int $numFiles;
  65. /** @readonly */
  66. public string $filename;
  67. /** @readonly */
  68. public string $comment;
  69. /** @tentative-return-type */
  70. public function open(string $filename, int $flags = 0): bool|int {}
  71. /** @tentative-return-type */
  72. public function setPassword(string $password): bool {}
  73. /** @tentative-return-type */
  74. public function close(): bool {}
  75. /** @tentative-return-type */
  76. public function count(): int {}
  77. /** @tentative-return-type */
  78. public function getStatusString(): string {}
  79. /** @tentative-return-type */
  80. public function addEmptyDir(string $dirname, int $flags = 0): bool {}
  81. /** @tentative-return-type */
  82. public function addFromString(string $name, string $content, int $flags = ZipArchive::FL_OVERWRITE): bool {}
  83. /** @tentative-return-type */
  84. public function addFile(string $filepath, string $entryname = "", int $start = 0, int $length = 0, int $flags = ZipArchive::FL_OVERWRITE): bool {}
  85. /** @tentative-return-type */
  86. public function replaceFile(string $filepath, int $index, int $start = 0, int $length = 0, int $flags = 0): bool {}
  87. /** @tentative-return-type */
  88. public function addGlob(string $pattern, int $flags = 0, array $options = []): array|false {}
  89. /** @tentative-return-type */
  90. public function addPattern(string $pattern, string $path = ".", array $options = []): array|false {}
  91. /** @tentative-return-type */
  92. public function renameIndex(int $index, string $new_name): bool {}
  93. /** @tentative-return-type */
  94. public function renameName(string $name, string $new_name): bool {}
  95. /** @tentative-return-type */
  96. public function setArchiveComment(string $comment): bool {}
  97. /** @tentative-return-type */
  98. public function getArchiveComment(int $flags = 0): string|false {}
  99. /** @tentative-return-type */
  100. public function setCommentIndex(int $index, string $comment): bool {}
  101. /** @tentative-return-type */
  102. public function setCommentName(string $name, string $comment): bool {}
  103. #ifdef HAVE_SET_MTIME
  104. /** @tentative-return-type */
  105. public function setMtimeIndex(int $index, int $timestamp, int $flags = 0): bool {}
  106. /** @tentative-return-type */
  107. public function setMtimeName(string $name, int $timestamp, int $flags = 0): bool {}
  108. #endif
  109. /** @tentative-return-type */
  110. public function getCommentIndex(int $index, int $flags = 0): string|false {}
  111. /** @tentative-return-type */
  112. public function getCommentName(string $name, int $flags = 0): string|false {}
  113. /** @tentative-return-type */
  114. public function deleteIndex(int $index): bool {}
  115. /** @tentative-return-type */
  116. public function deleteName(string $name): bool {}
  117. /** @tentative-return-type */
  118. public function statName(string $name, int $flags = 0): array|false {}
  119. /** @tentative-return-type */
  120. public function statIndex(int $index, int $flags = 0): array|false {}
  121. /** @tentative-return-type */
  122. public function locateName(string $name, int $flags = 0): int|false {}
  123. /** @tentative-return-type */
  124. public function getNameIndex(int $index, int $flags = 0): string|false {}
  125. /** @tentative-return-type */
  126. public function unchangeArchive(): bool {}
  127. /** @tentative-return-type */
  128. public function unchangeAll(): bool {}
  129. /** @tentative-return-type */
  130. public function unchangeIndex(int $index): bool {}
  131. /** @tentative-return-type */
  132. public function unchangeName(string $name): bool {}
  133. /** @tentative-return-type */
  134. public function extractTo(string $pathto, array|string|null $files = null): bool {}
  135. /** @tentative-return-type */
  136. public function getFromName(string $name, int $len = 0, int $flags = 0): string|false {}
  137. /** @tentative-return-type */
  138. public function getFromIndex(int $index, int $len = 0, int $flags = 0): string|false {}
  139. /** @return resource|false */
  140. public function getStream(string $name) {}
  141. #ifdef ZIP_OPSYS_DEFAULT
  142. /** @tentative-return-type */
  143. public function setExternalAttributesName(string $name, int $opsys, int $attr, int $flags = 0): bool {}
  144. /** @tentative-return-type */
  145. public function setExternalAttributesIndex(int $index, int $opsys, int $attr, int $flags = 0): bool {}
  146. /**
  147. * @param int $opsys
  148. * @param int $attr
  149. * @tentative-return-type
  150. */
  151. public function getExternalAttributesName(string $name, &$opsys, &$attr, int $flags = 0): bool {}
  152. /**
  153. * @param int $opsys
  154. * @param int $attr
  155. * @tentative-return-type
  156. */
  157. public function getExternalAttributesIndex(int $index, &$opsys, &$attr, int $flags = 0): bool {}
  158. #endif
  159. /** @tentative-return-type */
  160. public function setCompressionName(string $name, int $method, int $compflags = 0): bool {}
  161. /** @tentative-return-type */
  162. public function setCompressionIndex(int $index, int $method, int $compflags = 0): bool {}
  163. #ifdef HAVE_ENCRYPTION
  164. /** @tentative-return-type */
  165. public function setEncryptionName(string $name, int $method, ?string $password = null): bool {}
  166. /** @tentative-return-type */
  167. public function setEncryptionIndex(int $index, int $method, ?string $password = null): bool {}
  168. #endif
  169. #ifdef HAVE_PROGRESS_CALLBACK
  170. /** @tentative-return-type */
  171. public function registerProgressCallback(float $rate, callable $callback): bool {}
  172. #endif
  173. #ifdef HAVE_CANCEL_CALLBACK
  174. /** @tentative-return-type */
  175. public function registerCancelCallback(callable $callback): bool {}
  176. #endif
  177. #ifdef HAVE_METHOD_SUPPORTED
  178. public static function isCompressionMethodSupported(int $method, bool $enc = true): bool {}
  179. public static function isEncryptionMethodSupported(int $method, bool $enc = true): bool {}
  180. #endif
  181. }