1 <?hh // decl /* -*- mode: php -*- */
3 * Copyright (c) 2014, Facebook, Inc.
6 * This source code is licensed under the MIT license found in the
7 * LICENSE file in the "hack" directory of this source tree.
18 const FL_COMPRESSED = 4;
19 const FL_UNCHANGED = 8;
20 const FL_RECOMPRESS = 16;
21 const FL_ENCRYPTED = 32;
22 const ER_MULTIDISK = 1;
26 const ER_ZIPCLOSED = 8;
29 const ER_TMPOPEN = 12;
31 const ER_CHANGED = 15;
32 const ER_COMPNOTSUPP = 16;
35 const ER_INTERNAL = 20;
38 const ER_DELETED = 23;
39 const ER_ENCRNOTSUPP = 24;
41 const ER_NOPASSWD = 26;
42 const ER_WRONGPASSWD = 27;
43 const CM_DEFAULT = -1;
46 const CM_REDUCE_1 = 2;
47 const CM_REDUCE_2 = 3;
48 const CM_REDUCE_3 = 4;
49 const CM_REDUCE_4 = 5;
52 const CM_DEFLATE64 = 9;
53 const CM_PKWARE_IMPLODE = 10;
56 const CM_WAVPACK = 97;
72 public int $statusSys;
74 public string $filename;
75 public string $comment;
78 public function __construct();
79 public function addEmptyDir(string $dirname): bool;
80 public function addFile(
82 string $localname = "",
86 public function addFromString(string $localname, string $contents): bool;
87 public function addGlob(
90 /* HH_IGNORE_ERROR[2083] */
91 array $options = array(),
93 public function addPattern(
96 /* HH_IGNORE_ERROR[2083] */
97 array $options = array(),
99 public function close(): bool;
100 public function deleteIndex(int $index): bool;
101 public function deleteName(string $name): bool;
102 /* HH_IGNORE_ERROR[2083] */
103 public function extractTo(string $destination, $entries = array()): bool;
104 public function getArchiveComment(int $flags = 0): string;
105 public function getCommentIndex(int $index, int $flags = 0): string;
106 public function getCommentName(string $name, int $flags = 0): string;
107 public function getFromIndex(
112 public function getFromName(
117 public function getNameIndex(int $index, int $flags = 0): string;
118 public function getStatusString(): string;
119 public function getStream(string $name): mixed;
120 public function locateName(string $name, int $flags = 0): mixed;
121 public function open(string $filename, int $flags = 0): mixed;
122 public function renameIndex(int $index, string $newname): bool;
123 public function renameName(string $name, string $newname): bool;
124 public function setArchiveComment(string $comment): bool;
125 public function setCommentIndex(int $index, string $comment): bool;
126 public function setCommentName(string $name, string $comment): bool;
127 public function setCompressionIndex(
132 public function statIndex(int $index, int $flags = 0): array;
133 public function statName(string $name, int $flags = 0): array;
134 public function unchangeAll(): bool;
135 public function unchangeArchive(): bool;
136 public function unchangeIndex(int $index): bool;
137 public function unchangeName(string $name): bool;
142 * Close a ZIP file archive
145 function zip_close(resource $zip): void;
148 * Close a directory entry
151 function zip_entry_close(resource $zip_entry): bool;
154 * Retrieve the compressed size of a directory entry
157 function zip_entry_compressedsize(resource $zip_entry): int;
160 * Retrieve the compression method of a directory entry
163 function zip_entry_compressionmethod(resource $zip_entry): string;
166 * Retrieve the actual file size of a directory entry
169 function zip_entry_filesize(resource $zip_entry): int;
172 * Retrieve the name of a directory entry
175 function zip_entry_name(resource $zip_entry): string;
178 * Open a directory entry for reading
181 function zip_entry_open(
188 * Read from an open directory entry
191 function zip_entry_read(
197 * Open a ZIP file archive
200 function zip_open(string $filename): mixed; // resource or false
203 * Read next entry in a ZIP file archive
206 function zip_read(resource $zip); // resource or false