zip.php 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482
  1. <?php
  2. // Licensed under Apache-2.0
  3. // Copied from https://github.com/JetBrains/phpstorm-stubs/blob/master/zip/zip.php
  4. // Removed attributes
  5. // Start of zip v.1.14.0
  6. /**
  7. * A file archive, compressed with Zip.
  8. * @link https://php.net/manual/en/class.ziparchive.php
  9. */
  10. class ZipArchive implements Countable
  11. {
  12. /**
  13. * Zip library version
  14. * @link https://php.net/manual/en/zip.constants.php
  15. * @since 7.4.3
  16. */
  17. public const LIBZIP_VERSION = '1.7.3';
  18. /**
  19. * Create the archive if it does not exist.
  20. * @link https://php.net/manual/en/zip.constants.php
  21. */
  22. public const CREATE = 1;
  23. /**
  24. * Error if archive already exists.
  25. * @link https://php.net/manual/en/zip.constants.php
  26. */
  27. public const EXCL = 2;
  28. /**
  29. * Perform additional consistency checks on the archive, and error if they fail.
  30. * @link https://php.net/manual/en/zip.constants.php
  31. */
  32. public const CHECKCONS = 4;
  33. /**
  34. * Always start a new archive, this mode will overwrite the file if
  35. * it already exists.
  36. * @link https://php.net/manual/en/zip.constants.php
  37. */
  38. public const OVERWRITE = 8;
  39. /**
  40. * Ignore case on name lookup
  41. * @link https://php.net/manual/en/zip.constants.php
  42. */
  43. public const FL_NOCASE = 1;
  44. /**
  45. * Ignore directory component
  46. * @link https://php.net/manual/en/zip.constants.php
  47. */
  48. public const FL_NODIR = 2;
  49. /**
  50. * Read compressed data
  51. * @link https://php.net/manual/en/zip.constants.php
  52. */
  53. public const FL_COMPRESSED = 4;
  54. /**
  55. * Use original data, ignoring changes.
  56. * @link https://php.net/manual/en/zip.constants.php
  57. */
  58. public const FL_UNCHANGED = 8;
  59. public const FL_RECOMPRESS = 16;
  60. public const FL_ENCRYPTED = 32;
  61. public const FL_OVERWRITE = 8192;
  62. public const FL_LOCAL = 256;
  63. public const FL_CENTRAL = 512;
  64. public const EM_TRAD_PKWARE = 1;
  65. public const EM_UNKNOWN = 65535;
  66. /**
  67. * better of deflate or store.
  68. * @link https://php.net/manual/en/zip.constants.php
  69. */
  70. public const CM_DEFAULT = -1;
  71. /**
  72. * stored (uncompressed).
  73. * @link https://php.net/manual/en/zip.constants.php
  74. */
  75. public const CM_STORE = 0;
  76. /**
  77. * shrunk
  78. * @link https://php.net/manual/en/zip.constants.php
  79. */
  80. public const CM_SHRINK = 1;
  81. /**
  82. * reduced with factor 1
  83. * @link https://php.net/manual/en/zip.constants.php
  84. */
  85. public const CM_REDUCE_1 = 2;
  86. /**
  87. * reduced with factor 2
  88. * @link https://php.net/manual/en/zip.constants.php
  89. */
  90. public const CM_REDUCE_2 = 3;
  91. /**
  92. * reduced with factor 3
  93. * @link https://php.net/manual/en/zip.constants.php
  94. */
  95. public const CM_REDUCE_3 = 4;
  96. /**
  97. * reduced with factor 4
  98. * @link https://php.net/manual/en/zip.constants.php
  99. */
  100. public const CM_REDUCE_4 = 5;
  101. /**
  102. * imploded
  103. * @link https://php.net/manual/en/zip.constants.php
  104. */
  105. public const CM_IMPLODE = 6;
  106. /**
  107. * deflated
  108. * @link https://php.net/manual/en/zip.constants.php
  109. */
  110. public const CM_DEFLATE = 8;
  111. /**
  112. * deflate64
  113. * @link https://php.net/manual/en/zip.constants.php
  114. */
  115. public const CM_DEFLATE64 = 9;
  116. /**
  117. * PKWARE imploding
  118. * @link https://php.net/manual/en/zip.constants.php
  119. */
  120. public const CM_PKWARE_IMPLODE = 10;
  121. /**
  122. * BZIP2 algorithm
  123. * @link https://php.net/manual/en/zip.constants.php
  124. */
  125. public const CM_BZIP2 = 12;
  126. public const CM_LZMA = 14;
  127. public const CM_TERSE = 18;
  128. public const CM_LZ77 = 19;
  129. public const CM_WAVPACK = 97;
  130. public const CM_PPMD = 98;
  131. /**
  132. * No error.
  133. * @link https://php.net/manual/en/zip.constants.php
  134. */
  135. public const ER_OK = 0;
  136. /**
  137. * Multi-disk zip archives not supported.
  138. * @link https://php.net/manual/en/zip.constants.php
  139. */
  140. public const ER_MULTIDISK = 1;
  141. /**
  142. * Renaming temporary file failed.
  143. * @link https://php.net/manual/en/zip.constants.php
  144. */
  145. public const ER_RENAME = 2;
  146. /**
  147. * Closing zip archive failed
  148. * @link https://php.net/manual/en/zip.constants.php
  149. */
  150. public const ER_CLOSE = 3;
  151. /**
  152. * Seek error
  153. * @link https://php.net/manual/en/zip.constants.php
  154. */
  155. public const ER_SEEK = 4;
  156. /**
  157. * Read error
  158. * @link https://php.net/manual/en/zip.constants.php
  159. */
  160. public const ER_READ = 5;
  161. /**
  162. * Write error
  163. * @link https://php.net/manual/en/zip.constants.php
  164. */
  165. public const ER_WRITE = 6;
  166. /**
  167. * CRC error
  168. * @link https://php.net/manual/en/zip.constants.php
  169. */
  170. public const ER_CRC = 7;
  171. /**
  172. * Containing zip archive was closed
  173. * @link https://php.net/manual/en/zip.constants.php
  174. */
  175. public const ER_ZIPCLOSED = 8;
  176. /**
  177. * No such file.
  178. * @link https://php.net/manual/en/zip.constants.php
  179. */
  180. public const ER_NOENT = 9;
  181. /**
  182. * File already exists
  183. * @link https://php.net/manual/en/zip.constants.php
  184. */
  185. public const ER_EXISTS = 10;
  186. /**
  187. * Can't open file
  188. * @link https://php.net/manual/en/zip.constants.php
  189. */
  190. public const ER_OPEN = 11;
  191. /**
  192. * Failure to create temporary file.
  193. * @link https://php.net/manual/en/zip.constants.php
  194. */
  195. public const ER_TMPOPEN = 12;
  196. /**
  197. * Zlib error
  198. * @link https://php.net/manual/en/zip.constants.php
  199. */
  200. public const ER_ZLIB = 13;
  201. /**
  202. * Memory allocation failure
  203. * @link https://php.net/manual/en/zip.constants.php
  204. */
  205. public const ER_MEMORY = 14;
  206. /**
  207. * Entry has been changed
  208. * @link https://php.net/manual/en/zip.constants.php
  209. */
  210. public const ER_CHANGED = 15;
  211. /**
  212. * Compression method not supported.
  213. * @link https://php.net/manual/en/zip.constants.php
  214. */
  215. public const ER_COMPNOTSUPP = 16;
  216. /**
  217. * Premature EOF
  218. * @link https://php.net/manual/en/zip.constants.php
  219. */
  220. public const ER_EOF = 17;
  221. /**
  222. * Invalid argument
  223. * @link https://php.net/manual/en/zip.constants.php
  224. */
  225. public const ER_INVAL = 18;
  226. /**
  227. * Not a zip archive
  228. * @link https://php.net/manual/en/zip.constants.php
  229. */
  230. public const ER_NOZIP = 19;
  231. /**
  232. * Internal error
  233. * @link https://php.net/manual/en/zip.constants.php
  234. */
  235. public const ER_INTERNAL = 20;
  236. /**
  237. * Zip archive inconsistent
  238. * @link https://php.net/manual/en/zip.constants.php
  239. */
  240. public const ER_INCONS = 21;
  241. /**
  242. * Can't remove file
  243. * @link https://php.net/manual/en/zip.constants.php
  244. */
  245. public const ER_REMOVE = 22;
  246. /**
  247. * Entry has been deleted
  248. * @link https://php.net/manual/en/zip.constants.php
  249. */
  250. public const ER_DELETED = 23;
  251. /**
  252. * No encryption
  253. * @link https://secure.php.net/manual/en/zip.constants.php
  254. * @since 7.2
  255. */
  256. public const EM_NONE = 0;
  257. /**
  258. * AES 128 encryption
  259. * @link https://secure.php.net/manual/en/zip.constants.php
  260. * @since 7.2
  261. */
  262. public const EM_AES_128 = 257;
  263. /**
  264. * AES 192 encryption
  265. * @link https://secure.php.net/manual/en/zip.constants.php
  266. * @since 7.2
  267. */
  268. public const EM_AES_192 = 258;
  269. /**
  270. * AES 256 encryption
  271. * @link https://secure.php.net/manual/en/zip.constants.php
  272. * @since 7.2
  273. */
  274. public const EM_AES_256 = 259;
  275. /**
  276. * Open archive in read only mode
  277. * @link https://secure.php.net/manual/en/zip.constants.php
  278. * @since 7.4.3
  279. */
  280. public const RDONLY = 16;
  281. /**
  282. * Guess string encoding (is default)
  283. * @link https://secure.php.net/manual/en/zip.constants.php
  284. * @since 7.0.8
  285. */
  286. public const FL_ENC_GUESS = 0;
  287. /**
  288. * Get unmodified string
  289. * @link https://secure.php.net/manual/en/zip.constants.php
  290. * @since 7.0.8
  291. */
  292. public const FL_ENC_RAW = 64;
  293. /**
  294. * Follow specification strictly
  295. * @link https://secure.php.net/manual/en/zip.constants.php
  296. * @since 7.0.8
  297. */
  298. public const FL_ENC_STRICT = 128;
  299. /**
  300. * String is UTF-8 encoded
  301. * @link https://secure.php.net/manual/en/zip.constants.php
  302. * @since 7.0.8
  303. */
  304. public const FL_ENC_UTF_8 = 2048;
  305. /**
  306. * String is CP437 encoded
  307. * @link https://secure.php.net/manual/en/zip.constants.php
  308. * @since 7.0.8
  309. */
  310. public const FL_ENC_CP437 = 4096;
  311. /**
  312. * LZMA2 algorithm
  313. * @link https://secure.php.net/manual/en/zip.constants.php
  314. * @since 7.4.3
  315. */
  316. public const CM_LZMA2 = 33;
  317. /**
  318. * XZ algorithm
  319. * @link https://secure.php.net/manual/en/zip.constants.php
  320. * @since 7.4.3
  321. */
  322. public const CM_XZ = 95;
  323. /**
  324. * Encryption method not support
  325. * @link https://secure.php.net/manual/en/zip.constants.php
  326. * @since 7.4.3
  327. */
  328. public const ER_ENCRNOTSUPP = 24;
  329. /**
  330. * Read-only archive
  331. * @link https://secure.php.net/manual/en/zip.constants.php
  332. * @since 7.4.3
  333. */
  334. public const ER_RDONLY = 25;
  335. /**
  336. * No password provided
  337. * @link https://secure.php.net/manual/en/zip.constants.php
  338. * @since 7.4.3
  339. */
  340. public const ER_NOPASSWD = 26;
  341. /**
  342. * Wrong password provided
  343. * @link https://secure.php.net/manual/en/zip.constants.php
  344. * @since 7.4.3
  345. */
  346. public const ER_WRONGPASSWD = 27;
  347. /**
  348. * Operation not supported
  349. * @link https://secure.php.net/manual/en/zip.constants.php
  350. * @since 7.4.3
  351. */
  352. public const ER_OPNOTSUPP = 28;
  353. /**
  354. * Resource still in use
  355. * @link https://secure.php.net/manual/en/zip.constants.php
  356. * @since 7.4.3
  357. */
  358. public const ER_INUSE = 29;
  359. /**
  360. * Tell error
  361. * @link https://secure.php.net/manual/en/zip.constants.php
  362. * @since 7.4.3
  363. */
  364. public const ER_TELL = 30;
  365. /**
  366. * Compressed data invalid
  367. * @link https://secure.php.net/manual/en/zip.constants.php
  368. * @since 7.4.3
  369. */
  370. public const ER_COMPRESSED_DATA = 31;
  371. /**
  372. * Operation cancelled
  373. * @link https://secure.php.net/manual/en/zip.constants.php
  374. * @since 7.4.3
  375. */
  376. public const ER_CANCELLED = 32;
  377. /**
  378. * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default
  379. * @since 5.6
  380. */
  381. public const OPSYS_DOS = 0;
  382. /**
  383. * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default
  384. * @since 5.6
  385. */
  386. public const OPSYS_AMIGA = 1;
  387. /**
  388. * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default
  389. * @since 5.6
  390. */
  391. public const OPSYS_OPENVMS = 2;
  392. /**
  393. * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default
  394. * @since 5.6
  395. */
  396. public const OPSYS_UNIX = 3;
  397. /**
  398. * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default
  399. * @since 5.6
  400. */
  401. public const OPSYS_VM_CMS = 4;
  402. /**
  403. * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default
  404. * @since 5.6
  405. */
  406. public const OPSYS_ATARI_ST = 5;
  407. /**
  408. * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default
  409. * @since 5.6
  410. */
  411. public const OPSYS_OS_2 = 6;
  412. /**
  413. * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default
  414. * @since 5.6
  415. */
  416. public const OPSYS_MACINTOSH = 7;
  417. /**
  418. * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default
  419. * @since 5.6
  420. */
  421. public const OPSYS_Z_SYSTEM = 8;
  422. /**
  423. * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default
  424. * @removed 8.0 Use {@link ZipArchive::ZOPSYS_CPM} instead.
  425. * @since 5.6
  426. */
  427. public const OPSYS_Z_CPM = 9;
  428. /**
  429. * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default
  430. * @since 5.6
  431. */
  432. public const OPSYS_WINDOWS_NTFS = 10;
  433. /**
  434. * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default
  435. * @since 5.6
  436. */
  437. public const OPSYS_MVS = 11;
  438. /**
  439. * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default
  440. * @since 5.6
  441. */
  442. public const OPSYS_VSE = 12;
  443. /**
  444. * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default
  445. * @since 5.6
  446. */
  447. public const OPSYS_ACORN_RISC = 13;
  448. /**
  449. * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default
  450. * @since 5.6
  451. */
  452. public const OPSYS_VFAT = 14;
  453. /**
  454. * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default
  455. * @since 5.6
  456. */
  457. public const OPSYS_ALTERNATE_MVS = 15;
  458. /**
  459. * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default
  460. * @since 5.6
  461. */
  462. public const OPSYS_BEOS = 16;
  463. /**
  464. * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default
  465. * @since 5.6
  466. */
  467. public const OPSYS_TANDEM = 17;
  468. /**
  469. * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default
  470. * @since 5.6
  471. */
  472. public const OPSYS_OS_400 = 18;
  473. /**
  474. * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default
  475. * @since 5.6
  476. */
  477. public const OPSYS_OS_X = 19;
  478. /**
  479. * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default
  480. */
  481. public const OPSYS_CPM = 9;
  482. /**
  483. * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default
  484. * @since 5.6
  485. */
  486. public const OPSYS_DEFAULT = 3;
  487. /**
  488. * Status of the Zip Archive
  489. * @var int
  490. */
  491. public $status;
  492. /**
  493. * System status of the Zip Archive
  494. * @var int
  495. */
  496. public $statusSys;
  497. /**
  498. * Number of files in archive
  499. * @var int
  500. */
  501. public $numFiles;
  502. /**
  503. * File name in the file system
  504. * @var string
  505. */
  506. public $filename;
  507. /**
  508. * Comment for the archive
  509. * @var string
  510. */
  511. public $comment;
  512. /**
  513. * @var int
  514. */
  515. public $lastId;
  516. /**
  517. * (PHP 5 &gt;= 5.2.0, PECL zip &gt;= 1.1.0)<br/>
  518. * Open a ZIP file archive
  519. *
  520. * @link https://php.net/manual/en/ziparchive.open.php
  521. *
  522. * @param string $filename <p>
  523. * The file name of the ZIP archive to open.
  524. * </p>
  525. * @param int $flags [optional] <p>
  526. * The mode to use to open the archive.
  527. * </p>
  528. * <p>
  529. * <b>ZipArchive::OVERWRITE</b>
  530. * </p>
  531. *
  532. * @return mixed <i>Error codes</i>
  533. * <p>
  534. * Returns <b>TRUE</b> on success or the error code.
  535. * </p>
  536. * <p>
  537. * <b>ZipArchive::ER_EXISTS</b>
  538. * </p>
  539. * <p>
  540. * File already exists.
  541. * </p>
  542. * <p>
  543. * <b>ZipArchive::ER_INCONS</b>
  544. * </p>
  545. * <p>
  546. * Zip archive inconsistent.
  547. * </p>
  548. * <p>
  549. * <b>ZipArchive::ER_INVAL</b>
  550. * </p>
  551. * <p>
  552. * Invalid argument.
  553. * </p>
  554. * <p>
  555. * <b>ZipArchive::ER_MEMORY</b>
  556. * </p>
  557. * <p>
  558. * Malloc failure.
  559. * </p>
  560. * <p>
  561. * <b>ZipArchive::ER_NOENT</b>
  562. * </p>
  563. * <p>
  564. * No such file.
  565. * </p>
  566. * <p>
  567. * <b>ZipArchive::ER_NOZIP</b>
  568. * </p>
  569. * <p>
  570. * Not a zip archive.
  571. * </p>
  572. * <p>
  573. * <b>ZipArchive::ER_OPEN</b>
  574. * </p>
  575. * <p>
  576. * Can't open file.
  577. * </p>
  578. * <p>
  579. * <b>ZipArchive::ER_READ</b>
  580. * </p>
  581. * <p>
  582. * Read error.
  583. * </p>
  584. * <p>
  585. * <b>ZipArchive::ER_SEEK</b>
  586. * </p>
  587. * <p>
  588. * Seek error.
  589. * </p>
  590. */
  591. public function open(
  592. $filename,
  593. $flags = null
  594. ) {}
  595. /**
  596. * (PHP 5 &gt;= 5.2.0, PECL zip &gt;= 1.1.0)<br/>
  597. * Close the active archive (opened or newly created)
  598. * @link https://php.net/manual/en/ziparchive.close.php
  599. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  600. */
  601. public function close() {}
  602. /**
  603. * (PHP 7 &gt;= 7.2.0, PECL zip &gt;= 1.15.0)<br/>
  604. * Counts the number of files in the archive.
  605. * @link https://www.php.net/manual/en/ziparchive.count.php
  606. * @return int
  607. * @since 7.2
  608. */
  609. public function count() {}
  610. /**
  611. * Returns the status error message, system and/or zip messages
  612. * @link https://php.net/manual/en/ziparchive.getstatusstring.php
  613. * @return string|false a string with the status message on success or <b>FALSE</b> on failure.
  614. * @since 5.2.7
  615. */
  616. public function getStatusString() {}
  617. /**
  618. * (PHP 5 &gt;= 5.2.0, PECL zip &gt;= 1.8.0)<br/>
  619. * Add a new directory
  620. * @link https://php.net/manual/en/ziparchive.addemptydir.php
  621. * @param string $dirname <p>
  622. * The directory to add.
  623. * </p>
  624. * @param int $flags [optional] Set how to manage name encoding (ZipArchive::FL_ENC_*) and entry replacement (ZipArchive::FL_OVERWRITE)
  625. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  626. */
  627. public function addEmptyDir(
  628. string $dirname,
  629. int $flags = 0
  630. ) {}
  631. /**
  632. * (PHP 5 &gt;= 5.2.0, PECL zip &gt;= 1.1.0)<br/>
  633. * Add a file to a ZIP archive using its contents
  634. * @link https://php.net/manual/en/ziparchive.addfromstring.php
  635. * @param string $name <p>
  636. * The name of the entry to create.
  637. * </p>
  638. * @param string $content <p>
  639. * The contents to use to create the entry. It is used in a binary
  640. * safe mode.
  641. * </p>
  642. * @param int $flags [optional] Set how to manage name encoding (ZipArchive::FL_ENC_*) and entry replacement (ZipArchive::FL_OVERWRITE)
  643. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  644. */
  645. public function addFromString(
  646. $name,
  647. $content,
  648. $flags = 8192
  649. ) {}
  650. /**
  651. * (PHP 5 &gt;= 5.2.0, PECL zip &gt;= 1.1.0)<br/>
  652. * Adds a file to a ZIP archive from the given path
  653. * @link https://php.net/manual/en/ziparchive.addfile.php
  654. * @param string $filepath <p>
  655. * The path to the file to add.
  656. * </p>
  657. * @param string $entryname [optional] <p>
  658. * If supplied, this is the local name inside the ZIP archive that will override the <i>filename</i>.
  659. * </p>
  660. * @param int $start [optional] <p>
  661. * This parameter is not used but is required to extend <b>ZipArchive</b>.
  662. * </p>
  663. * @param int $length [optional] <p>
  664. * This parameter is not used but is required to extend <b>ZipArchive</b>.
  665. * </p>
  666. * @param int $flags [optional] Set how to manage name encoding (ZipArchive::FL_ENC_*) and entry replacement (ZipArchive::FL_OVERWRITE)
  667. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  668. */
  669. public function addFile(
  670. $filepath,
  671. $entryname = null,
  672. $start = 0,
  673. $length = 0,
  674. $flags = 8192
  675. ) {}
  676. /**
  677. * (PHP 5 &gt;= 5.3.0, PECL zip &gt;= 1.9.0)<br/>
  678. * Add files from a directory by glob pattern
  679. * @link https://php.net/manual/en/ziparchive.addglob.php
  680. * @param string $pattern <p>
  681. * A <b>glob</b> pattern against which files will be matched.
  682. * </p>
  683. * @param int $flags [optional] <p>
  684. * A bit mask of glob() flags.
  685. * </p>
  686. * @param array $options [optional] <p>
  687. * An associative array of options. Available options are:
  688. * </p>
  689. * <p>
  690. * "add_path"
  691. * </p>
  692. * <p>
  693. * Prefix to prepend when translating to the local path of the file within
  694. * the archive. This is applied after any remove operations defined by the
  695. * "remove_path" or "remove_all_path"
  696. * options.
  697. * </p>
  698. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  699. */
  700. public function addGlob(
  701. $pattern,
  702. $flags = 0,
  703. array $options = []
  704. ) {}
  705. /**
  706. * (PHP 5 &gt;= 5.3.0, PECL zip &gt;= 1.9.0)<br/>
  707. * Add files from a directory by PCRE pattern
  708. * @link https://php.net/manual/en/ziparchive.addpattern.php
  709. * @param string $pattern <p>
  710. * A PCRE pattern against which files will be matched.
  711. * </p>
  712. * @param string $path [optional] <p>
  713. * The directory that will be scanned. Defaults to the current working directory.
  714. * </p>
  715. * @param array $options [optional] <p>
  716. * An associative array of options accepted by <b>ZipArchive::addGlob</b>.
  717. * </p>
  718. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  719. */
  720. public function addPattern(
  721. $pattern,
  722. $path = '.',
  723. array $options = []
  724. ) {}
  725. /**
  726. * (PHP 5 &gt;= 5.2.0, PECL zip &gt;= 1.5.0)<br/>
  727. * Renames an entry defined by its index
  728. * @link https://php.net/manual/en/ziparchive.renameindex.php
  729. * @param int $index <p>
  730. * Index of the entry to rename.
  731. * </p>
  732. * @param string $new_name <p>
  733. * New name.
  734. * </p>
  735. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  736. */
  737. public function renameIndex(
  738. $index,
  739. $new_name
  740. ) {}
  741. /**
  742. * (PHP 5 &gt;= 5.2.0, PECL zip &gt;= 1.5.0)<br/>
  743. * Renames an entry defined by its name
  744. * @link https://php.net/manual/en/ziparchive.renamename.php
  745. * @param string $name <p>
  746. * Name of the entry to rename.
  747. * </p>
  748. * @param string $new_name <p>
  749. * New name.
  750. * </p>
  751. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  752. */
  753. public function renameName(
  754. $name,
  755. $new_name
  756. ) {}
  757. /**
  758. * (PHP 5 &gt;= 5.2.0, PECL zip &gt;= 1.4.0)<br/>
  759. * Set the comment of a ZIP archive
  760. * @link https://php.net/manual/en/ziparchive.setarchivecomment.php
  761. * @param string $comment <p>
  762. * The contents of the comment.
  763. * </p>
  764. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  765. */
  766. public function setArchiveComment( $comment) {}
  767. /**
  768. * (PHP 5 &gt;= 5.2.0, PECL zip &gt;= 1.1.0)<br/>
  769. * Returns the Zip archive comment
  770. * @link https://php.net/manual/en/ziparchive.getarchivecomment.php
  771. * @param int $flags [optional] <p>
  772. * If flags is set to <b>ZipArchive::FL_UNCHANGED</b>, the original unchanged
  773. * comment is returned.
  774. * </p>
  775. * @return string|false the Zip archive comment or <b>FALSE</b> on failure.
  776. */
  777. public function getArchiveComment( $flags = null) {}
  778. /**
  779. * (PHP 5 &gt;= 5.2.0, PECL zip &gt;= 1.4.0)<br/>
  780. * Set the comment of an entry defined by its index
  781. * @link https://php.net/manual/en/ziparchive.setcommentindex.php
  782. * @param int $index <p>
  783. * Index of the entry.
  784. * </p>
  785. * @param string $comment <p>
  786. * The contents of the comment.
  787. * </p>
  788. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  789. */
  790. public function setCommentIndex(
  791. $index,
  792. $comment
  793. ) {}
  794. /**
  795. * (PHP 5 &gt;= 5.2.0, PECL zip &gt;= 1.4.0)<br/>
  796. * Set the comment of an entry defined by its name
  797. * @link https://php.net/manual/en/ziparchive.setcommentname.php
  798. * @param string $name <p>
  799. * Name of the entry.
  800. * </p>
  801. * @param string $comment <p>
  802. * The contents of the comment.
  803. * </p>
  804. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  805. */
  806. public function setCommentName(
  807. $name,
  808. $comment
  809. ) {}
  810. /**
  811. * Set the compression method of an entry defined by its index
  812. * @link https://php.net/manual/en/ziparchive.setcompressionindex.php
  813. * @param int $index Index of the entry.
  814. * @param int $method The compression method. Either ZipArchive::CM_DEFAULT, ZipArchive::CM_STORE or ZipArchive::CM_DEFLATE.
  815. * @param int $compflags [optional] Compression flags. Currently unused.
  816. * @return bool Returns TRUE on success or FALSE on failure.
  817. * @since 7.0
  818. */
  819. public function setCompressionIndex(int $index, int $method, int $compflags = 0) {}
  820. /**
  821. * Set the compression method of an entry defined by its name
  822. * https://secure.php.net/manual/en/ziparchive.setcompressionname.php
  823. * @param string $name Name of the entry.
  824. * @param int $method The compression method. Either ZipArchive::CM_DEFAULT, ZipArchive::CM_STORE or ZipArchive::CM_DEFLATE.
  825. * @param int $compflags [optional] Compression flags. Currently unused.
  826. * @return bool Returns TRUE on success or FALSE on failure.
  827. * @since 7.0
  828. */
  829. public function setCompressionName(string $name, int $method, int $compflags = 0) {}
  830. /**
  831. * Set the encryption method of an entry defined by its index
  832. * @link https://php.net/manual/en/ziparchive.setencryptionindex.php
  833. * @param int $index Index of the entry.
  834. * @param int $method The encryption method defined by one of the ZipArchive::EM_ constants.
  835. * @param string|null $password [optional] Optional password, default used when missing.
  836. * @return bool Returns TRUE on success or FALSE on failure.
  837. * @since 7.2
  838. */
  839. public function setEncryptionIndex(int $index, int $method, ?string $password = null) {}
  840. /**
  841. * Set the encryption method of an entry defined by its name
  842. * @link https://php.net/manual/en/ziparchive.setencryptionname.php
  843. * @param string $name Name of the entry.
  844. * @param int $method The encryption method defined by one of the ZipArchive::EM_ constants.
  845. * @param string|null $password [optional] Optional password, default used when missing.
  846. * @return bool Returns TRUE on success or FALSE on failure.
  847. * @since 7.2
  848. */
  849. public function setEncryptionName(string $name, int $method, ?string $password = null) {}
  850. /**
  851. * (PHP 5 &gt;= 5.6.0, PECL zip &gt;= 1.12.0)<br/>
  852. * @param string $password
  853. * @return bool
  854. */
  855. public function setPassword( $password) {}
  856. /**
  857. * (PHP 5 &gt;= 5.2.0, PECL zip &gt;= 1.4.0)<br/>
  858. * Returns the comment of an entry using the entry index
  859. * @link https://php.net/manual/en/ziparchive.getcommentindex.php
  860. * @param int $index <p>
  861. * Index of the entry
  862. * </p>
  863. * @param int $flags [optional] <p>
  864. * If flags is set to <b>ZipArchive::FL_UNCHANGED</b>, the original unchanged
  865. * comment is returned.
  866. * </p>
  867. * @return string|false the comment on success or <b>FALSE</b> on failure.
  868. */
  869. public function getCommentIndex(
  870. $index,
  871. $flags = null
  872. ) {}
  873. /**
  874. * (PHP 5 &gt;= 5.2.0, PECL zip &gt;= 1.4.0)<br/>
  875. * Returns the comment of an entry using the entry name
  876. * @link https://php.net/manual/en/ziparchive.getcommentname.php
  877. * @param string $name <p>
  878. * Name of the entry
  879. * </p>
  880. * @param int $flags [optional] <p>
  881. * If flags is set to <b>ZipArchive::FL_UNCHANGED</b>, the original unchanged
  882. * comment is returned.
  883. * </p>
  884. * @return string|false the comment on success or <b>FALSE</b> on failure.
  885. */
  886. public function getCommentName(
  887. $name,
  888. $flags = null
  889. ) {}
  890. /**
  891. * (PHP 5 &gt;= 5.2.0, PECL zip &gt;= 1.5.0)<br/>
  892. * delete an entry in the archive using its index
  893. * @link https://php.net/manual/en/ziparchive.deleteindex.php
  894. * @param int $index <p>
  895. * Index of the entry to delete.
  896. * </p>
  897. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  898. */
  899. public function deleteIndex( $index) {}
  900. /**
  901. * (PHP 5 &gt;= 5.2.0, PECL zip &gt;= 1.5.0)<br/>
  902. * delete an entry in the archive using its name
  903. * @link https://php.net/manual/en/ziparchive.deletename.php
  904. * @param string $name <p>
  905. * Name of the entry to delete.
  906. * </p>
  907. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  908. */
  909. public function deleteName( $name) {}
  910. /**
  911. * (PHP 5 &gt;= 5.2.0, PECL zip &gt;= 1.5.0)<br/>
  912. * Get the details of an entry defined by its name.
  913. * @link https://php.net/manual/en/ziparchive.statname.php
  914. * @param string $name <p>
  915. * Name of the entry
  916. * </p>
  917. * @param int $flags [optional] <p>
  918. * The flags argument specifies how the name lookup should be done.
  919. * Also, <b>ZipArchive::FL_UNCHANGED</b> may be ORed to it to request
  920. * information about the original file in the archive,
  921. * ignoring any changes made.
  922. * <b>ZipArchive::FL_NOCASE</b>
  923. * </p>
  924. * @return array|false an array containing the entry details or <b>FALSE</b> on failure.
  925. */
  926. public function statName(
  927. $name,
  928. $flags = null
  929. ) {}
  930. /**
  931. * (PHP 5 &gt;= 5.2.0, PECL zip &gt;= 1.1.0)<br/>
  932. * Get the details of an entry defined by its index.
  933. * @link https://php.net/manual/en/ziparchive.statindex.php
  934. * @param int $index <p>
  935. * Index of the entry
  936. * </p>
  937. * @param int $flags [optional] <p>
  938. * <b>ZipArchive::FL_UNCHANGED</b> may be ORed to it to request
  939. * information about the original file in the archive,
  940. * ignoring any changes made.
  941. * </p>
  942. * @return array|false an array containing the entry details or <b>FALSE</b> on failure.
  943. */
  944. public function statIndex(
  945. $index,
  946. $flags = null
  947. ) {}
  948. /**
  949. * (PHP 5 &gt;= 5.2.0, PECL zip &gt;= 1.5.0)<br/>
  950. * Returns the index of the entry in the archive
  951. * @link https://php.net/manual/en/ziparchive.locatename.php
  952. * @param string $name <p>
  953. * The name of the entry to look up
  954. * </p>
  955. * @param int $flags [optional] <p>
  956. * The flags are specified by ORing the following values,
  957. * or 0 for none of them.
  958. * <b>ZipArchive::FL_NOCASE</b>
  959. * </p>
  960. * @return int|false the index of the entry on success or <b>FALSE</b> on failure.
  961. */
  962. public function locateName(
  963. $name,
  964. $flags = null
  965. ) {}
  966. /**
  967. * (PHP 5 &gt;= 5.2.0, PECL zip &gt;= 1.5.0)<br/>
  968. * Returns the name of an entry using its index
  969. * @link https://php.net/manual/en/ziparchive.getnameindex.php
  970. * @param int $index <p>
  971. * Index of the entry.
  972. * </p>
  973. * @param int $flags [optional] <p>
  974. * If flags is set to <b>ZipArchive::FL_UNCHANGED</b>, the original unchanged
  975. * name is returned.
  976. * </p>
  977. * @return string|false the name on success or <b>FALSE</b> on failure.
  978. */
  979. public function getNameIndex(
  980. $index,
  981. $flags = null
  982. ) {}
  983. /**
  984. * (PHP 5 &gt;= 5.2.0, PECL zip &gt;= 1.1.0)<br/>
  985. * Revert all global changes done in the archive.
  986. * @link https://php.net/manual/en/ziparchive.unchangearchive.php
  987. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  988. */
  989. public function unchangeArchive() {}
  990. /**
  991. * (PHP 5 &gt;= 5.2.0, PECL zip &gt;= 1.1.0)<br/>
  992. * Undo all changes done in the archive
  993. * @link https://php.net/manual/en/ziparchive.unchangeall.php
  994. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  995. */
  996. public function unchangeAll() {}
  997. /**
  998. * (PHP 5 &gt;= 5.2.0, PECL zip &gt;= 1.1.0)<br/>
  999. * Revert all changes done to an entry at the given index
  1000. * @link https://php.net/manual/en/ziparchive.unchangeindex.php
  1001. * @param int $index <p>
  1002. * Index of the entry.
  1003. * </p>
  1004. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1005. */
  1006. public function unchangeIndex( $index) {}
  1007. /**
  1008. * (PHP 5 &gt;= 5.2.0, PECL zip &gt;= 1.5.0)<br/>
  1009. * Revert all changes done to an entry with the given name.
  1010. * @link https://php.net/manual/en/ziparchive.unchangename.php
  1011. * @param string $name <p>
  1012. * Name of the entry.
  1013. * </p>
  1014. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1015. */
  1016. public function unchangeName( $name) {}
  1017. /**
  1018. * (PHP 5 &gt;= 5.2.0, PECL zip &gt;= 1.1.0)<br/>
  1019. * Extract the archive contents
  1020. * @link https://php.net/manual/en/ziparchive.extractto.php
  1021. * @param string $pathto <p>
  1022. * Location where to extract the files.
  1023. * </p>
  1024. * @param mixed $files [optional] <p>
  1025. * The entries to extract. It accepts either a single entry name or
  1026. * an array of names.
  1027. * </p>
  1028. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1029. */
  1030. public function extractTo(
  1031. $pathto,
  1032. $files = null
  1033. ) {}
  1034. /**
  1035. * (PHP 5 &gt;= 5.2.0, PECL zip &gt;= 1.1.0)<br/>
  1036. * Returns the entry contents using its name
  1037. * @link https://php.net/manual/en/ziparchive.getfromname.php
  1038. * @param string $name <p>
  1039. * Name of the entry
  1040. * </p>
  1041. * @param int $len [optional] <p>
  1042. * The length to be read from the entry. If 0, then the
  1043. * entire entry is read.
  1044. * </p>
  1045. * @param int $flags [optional] <p>
  1046. * The flags to use to open the archive. the following values may
  1047. * be ORed to it.
  1048. * <b>ZipArchive::FL_UNCHANGED</b>
  1049. * </p>
  1050. * @return string|false the contents of the entry on success or <b>FALSE</b> on failure.
  1051. */
  1052. public function getFromName(
  1053. $name,
  1054. $len = 0,
  1055. $flags = null
  1056. ) {}
  1057. /**
  1058. * (PHP 5 &gt;= 5.2.0, PECL zip &gt;= 1.3.0)<br/>
  1059. * Returns the entry contents using its index
  1060. * @link https://php.net/manual/en/ziparchive.getfromindex.php
  1061. * @param int $index <p>
  1062. * Index of the entry
  1063. * </p>
  1064. * @param int $len [optional] <p>
  1065. * The length to be read from the entry. If 0, then the
  1066. * entire entry is read.
  1067. * </p>
  1068. * @param int $flags [optional] <p>
  1069. * The flags to use to open the archive. the following values may
  1070. * be ORed to it.
  1071. * </p>
  1072. * <p>
  1073. * <b>ZipArchive::FL_UNCHANGED</b>
  1074. * </p>
  1075. * @return string|false the contents of the entry on success or <b>FALSE</b> on failure.
  1076. */
  1077. public function getFromIndex(
  1078. $index,
  1079. $len = 0,
  1080. $flags = null
  1081. ) {}
  1082. /**
  1083. * (PHP 5 &gt;= 5.2.0, PECL zip &gt;= 1.1.0)<br/>
  1084. * Get a file handler to the entry defined by its name (read only).
  1085. * @link https://php.net/manual/en/ziparchive.getstream.php
  1086. * @param string $name <p>
  1087. * The name of the entry to use.
  1088. * </p>
  1089. * @return resource|false a file pointer (resource) on success or <b>FALSE</b> on failure.
  1090. */
  1091. public function getStream( $name) {}
  1092. /**
  1093. * Set the external attributes of an entry defined by its name
  1094. * @link https://www.php.net/manual/en/ziparchive.setexternalattributesname.php
  1095. * @param string $name Name of the entry
  1096. * @param int $opsys The operating system code defined by one of the ZipArchive::OPSYS_ constants.
  1097. * @param int $attr The external attributes. Value depends on operating system.
  1098. * @param int $flags [optional] Optional flags. Currently unused.
  1099. * @return bool Returns <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1100. */
  1101. public function setExternalAttributesName(
  1102. $name,
  1103. $opsys,
  1104. $attr,
  1105. $flags = null
  1106. ) {}
  1107. /**
  1108. * Retrieve the external attributes of an entry defined by its name
  1109. * @link https://www.php.net/manual/en/ziparchive.getexternalattributesname.php
  1110. * @param string $name Name of the entry
  1111. * @param int &$opsys On success, receive the operating system code defined by one of the ZipArchive::OPSYS_ constants.
  1112. * @param int &$attr On success, receive the external attributes. Value depends on operating system.
  1113. * @param int $flags [optional] If flags is set to ZipArchive::FL_UNCHANGED, the original unchanged attributes are returned.
  1114. * @return bool Returns <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1115. */
  1116. public function getExternalAttributesName(
  1117. $name,
  1118. &$opsys,
  1119. &$attr,
  1120. $flags = null
  1121. ) {}
  1122. /**
  1123. * Set the external attributes of an entry defined by its index
  1124. * @link https://www.php.net/manual/en/ziparchive.setexternalattributesindex.php
  1125. * @param int $index Index of the entry.
  1126. * @param int $opsys The operating system code defined by one of the ZipArchive::OPSYS_ constants.
  1127. * @param int $attr The external attributes. Value depends on operating system.
  1128. * @param int $flags [optional] Optional flags. Currently unused.
  1129. * @return bool Returns <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1130. */
  1131. public function setExternalAttributesIndex(
  1132. $index,
  1133. $opsys,
  1134. $attr,
  1135. $flags = null
  1136. ) {}
  1137. /**
  1138. * Retrieve the external attributes of an entry defined by its index
  1139. * @link https://www.php.net/manual/en/ziparchive.getexternalattributesindex.php
  1140. * @param int $index Index of the entry.
  1141. * @param int &$opsys On success, receive the operating system code defined by one of the ZipArchive::OPSYS_ constants.
  1142. * @param int &$attr On success, receive the external attributes. Value depends on operating system.
  1143. * @param int $flags [optional] If flags is set to ZipArchive::FL_UNCHANGED, the original unchanged attributes are returned.
  1144. * @return bool Returns <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1145. */
  1146. public function getExternalAttributesIndex(
  1147. $index,
  1148. &$opsys,
  1149. &$attr,
  1150. $flags = null
  1151. ) {}
  1152. public static function isEncryptionMethodSupported(
  1153. $method,
  1154. $enc = true
  1155. ) {}
  1156. public static function isCompressionMethodSupported(
  1157. $method,
  1158. $enc = true
  1159. ) {}
  1160. public function registerCancelCallback( $callback) {}
  1161. public function registerProgressCallback(
  1162. $rate,
  1163. $callback
  1164. ) {}
  1165. public function setMtimeName(
  1166. $name,
  1167. $timestamp,
  1168. $flags = null
  1169. ) {}
  1170. public function setMtimeIndex(
  1171. $index,
  1172. $timestamp,
  1173. $flags = null
  1174. ) {}
  1175. public function replaceFile(
  1176. $filepath,
  1177. $index,
  1178. $start = null,
  1179. $length = null,
  1180. $flags = null
  1181. ) {}
  1182. }
  1183. /**
  1184. * (PHP 4 &gt;= 4.1.0, PHP 5 &gt;= 5.2.0, PECL zip &gt;= 1.0.0)<br/>
  1185. * Open a ZIP file archive
  1186. * @link https://php.net/manual/en/function.zip-open.php
  1187. * @param string $filename <p>
  1188. * The file name of the ZIP archive to open.
  1189. * </p>
  1190. * @return resource|int|false a resource handle for later use with
  1191. * <b>zip_read</b> and <b>zip_close</b>
  1192. * or returns the number of error if <i>filename</i> does not
  1193. * exist or in case of other error.
  1194. * @deprecated 8.0 Use {@link ZipArchive} instead.
  1195. */
  1196. function zip_open(string $filename) {}
  1197. /**
  1198. * (PHP 4 &gt;= 4.1.0, PHP 5 &gt;= 5.2.0, PECL zip &gt;= 1.0.0)<br/>
  1199. * Close a ZIP file archive
  1200. * @link https://php.net/manual/en/function.zip-close.php
  1201. * @param resource $zip <p>
  1202. * A ZIP file previously opened with <b>zip_open</b>.
  1203. * </p>
  1204. * @return void No value is returned.
  1205. * @deprecated 8.0 Use {@link ZipArchive} instead.
  1206. */
  1207. function zip_close($zip): void {}
  1208. /**
  1209. * (PHP 4 &gt;= 4.1.0, PHP 5 &gt;= 5.2.0, PECL zip &gt;= 1.0.0)<br/>
  1210. * Read next entry in a ZIP file archive
  1211. * @link https://php.net/manual/en/function.zip-read.php
  1212. * @param resource $zip <p>
  1213. * A ZIP file previously opened with <b>zip_open</b>.
  1214. * </p>
  1215. * @return resource|false a directory entry resource for later use with the
  1216. * zip_entry_... functions, or <b>FALSE</b> if
  1217. * there are no more entries to read, or an error code if an error
  1218. * occurred.
  1219. * @deprecated 8.0 Use {@link ZipArchive} instead.
  1220. */
  1221. function zip_read($zip) {}
  1222. /**
  1223. * (PHP 4 &gt;= 4.1.0, PHP 5 &gt;= 5.2.0, PECL zip &gt;= 1.0.0)<br/>
  1224. * Open a directory entry for reading
  1225. * @link https://php.net/manual/en/function.zip-entry-open.php
  1226. * @param resource $zip_dp <p>
  1227. * A valid resource handle returned by <b>zip_open</b>.
  1228. * </p>
  1229. * @param resource $zip_entry <p>
  1230. * A directory entry returned by <b>zip_read</b>.
  1231. * </p>
  1232. * @param string $mode [optional] <p>
  1233. * Any of the modes specified in the documentation of
  1234. * <b>fopen</b>.
  1235. * </p>
  1236. * <p>
  1237. * Currently, <i>mode</i> is ignored and is always
  1238. * "rb". This is due to the fact that zip support
  1239. * in PHP is read only access.
  1240. * </p>
  1241. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1242. * <p>
  1243. * Unlike <b>fopen</b> and other similar functions,
  1244. * the return value of <b>zip_entry_open</b> only
  1245. * indicates the result of the operation and is not needed for
  1246. * reading or closing the directory entry.
  1247. * </p>
  1248. */
  1249. function zip_entry_open($zip_dp, $zip_entry, string $mode = 'rb'): bool {}
  1250. /**
  1251. * (PHP 4 &gt;= 4.1.0, PHP 5 &gt;= 5.2.0, PECL zip &gt;= 1.0.0)<br/>
  1252. * Close a directory entry
  1253. * @link https://php.net/manual/en/function.zip-entry-close.php
  1254. * @param resource $zip_entry <p>
  1255. * A directory entry previously opened <b>zip_entry_open</b>.
  1256. * </p>
  1257. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1258. * @deprecated 8.0 Use {@link ZipArchive} instead.
  1259. */
  1260. function zip_entry_close($zip_entry): bool {}
  1261. /**
  1262. * (PHP 4 &gt;= 4.1.0, PHP 5 &gt;= 5.2.0, PECL zip &gt;= 1.0.0)<br/>
  1263. * Read from an open directory entry
  1264. * @link https://php.net/manual/en/function.zip-entry-read.php
  1265. * @param resource $zip_entry <p>
  1266. * A directory entry returned by <b>zip_read</b>.
  1267. * </p>
  1268. * @param int $len [optional] <p>
  1269. * The number of bytes to return.
  1270. * </p>
  1271. * <p>
  1272. * This should be the uncompressed length you wish to read.
  1273. * </p>
  1274. * @return string|false the data read, empty string on end of a file, or <b>FALSE</b> on error.
  1275. * @deprecated 8.0 Use {@link ZipArchive} instead.
  1276. */
  1277. function zip_entry_read($zip_entry, int $len = 1024): string|false {}
  1278. /**
  1279. * (PHP 4 &gt;= 4.1.0, PHP 5 &gt;= 5.2.0, PECL zip &gt;= 1.0.0)<br/>
  1280. * Retrieve the actual file size of a directory entry
  1281. * @link https://php.net/manual/en/function.zip-entry-filesize.php
  1282. * @param resource $zip_entry <p>
  1283. * A directory entry returned by <b>zip_read</b>.
  1284. * </p>
  1285. * @return int|false The size of the directory entry.
  1286. * @deprecated 8.0 Use {@link ZipArchive} instead.
  1287. */
  1288. function zip_entry_filesize($zip_entry): int|false {}
  1289. /**
  1290. * (PHP 4 &gt;= 4.1.0, PHP 5 &gt;= 5.2.0, PECL zip &gt;= 1.0.0)<br/>
  1291. * Retrieve the name of a directory entry
  1292. * @link https://php.net/manual/en/function.zip-entry-name.php
  1293. * @param resource $zip_entry <p>
  1294. * A directory entry returned by <b>zip_read</b>.
  1295. * </p>
  1296. * @return string|false The name of the directory entry.
  1297. * @deprecated 8.0 Use {@link ZipArchive} instead.
  1298. */
  1299. function zip_entry_name($zip_entry): string|false {}
  1300. /**
  1301. * (PHP 4 &gt;= 4.1.0, PHP 5 &gt;= 5.2.0, PECL zip &gt;= 1.0.0)<br/>
  1302. * Retrieve the compressed size of a directory entry
  1303. * @link https://php.net/manual/en/function.zip-entry-compressedsize.php
  1304. * @param resource $zip_entry <p>
  1305. * A directory entry returned by <b>zip_read</b>.
  1306. * </p>
  1307. * @return int|false The compressed size.
  1308. * @deprecated 8.0 Use {@link ZipArchive} instead.
  1309. */
  1310. function zip_entry_compressedsize($zip_entry): int|false {}
  1311. /**
  1312. * (PHP 4 &gt;= 4.1.0, PHP 5 &gt;= 5.2.0, PECL zip &gt;= 1.0.0)<br/>
  1313. * Retrieve the compression method of a directory entry
  1314. * @link https://php.net/manual/en/function.zip-entry-compressionmethod.php
  1315. * @param resource $zip_entry <p>
  1316. * A directory entry returned by <b>zip_read</b>.
  1317. * </p>
  1318. * @return string|false The compression method.
  1319. * @deprecated 8.0 Use {@link ZipArchive} instead.
  1320. */
  1321. function zip_entry_compressionmethod($zip_entry): string|false {}
  1322. // End of zip v.1.11.0