1 <?hh /* -*- 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 int FL_COMPRESSED;
19 const int FL_UNCHANGED;
20 const int FL_RECOMPRESS;
21 const int FL_ENCRYPTED;
22 const int ER_MULTIDISK;
26 const int ER_ZIPCLOSED;
32 const int ER_COMPNOTSUPP;
35 const int ER_INTERNAL;
39 const int ER_ENCRNOTSUPP;
41 const int ER_NOPASSWD;
42 const int ER_WRONGPASSWD;
46 const int CM_REDUCE_1;
47 const int CM_REDUCE_2;
48 const int CM_REDUCE_3;
49 const int CM_REDUCE_4;
52 const int CM_DEFLATE64;
53 const int CM_PKWARE_IMPLODE;
76 public int $statusSys;
78 public string $filename;
79 public string $comment;
82 public function __construct();
83 public function addEmptyDir(string $dirname): bool;
84 public function addFile(
86 string $localname = "",
90 public function addFromString(string $localname, string $contents): bool;
91 public function addGlob(
94 darray<arraykey, mixed> $options = dict[],
96 public function addPattern(
99 darray<arraykey, mixed> $options = dict[],
101 public function close(): bool;
102 public function deleteIndex(int $index): bool;
103 public function deleteName(string $name): bool;
104 public function extractTo(
106 HH\FIXME\MISSING_PARAM_TYPE $entries = vec[],
108 public function getArchiveComment(int $flags = 0): string;
109 public function getCommentIndex(int $index, int $flags = 0): string;
110 public function getCommentName(string $name, int $flags = 0): string;
111 public function getFromIndex(
116 public function getFromName(
121 public function getNameIndex(int $index, int $flags = 0): string;
122 public function getStatusString(): string;
123 public function getStream(string $name): mixed;
124 public function locateName(string $name, int $flags = 0): mixed;
125 public function open(string $filename, int $flags = 0): mixed;
126 public function renameIndex(int $index, string $newname): bool;
127 public function renameName(string $name, string $newname): bool;
128 public function setArchiveComment(string $comment): bool;
129 public function setCommentIndex(int $index, string $comment): bool;
130 public function setCommentName(string $name, string $comment): bool;
131 public function setCompressionIndex(
136 public function setEncryptionIndex(
138 int $encryption_method,
141 public function setEncryptionName(
143 int $encryption_method,
146 public function statIndex(int $index, int $flags = 0): darray<arraykey, mixed>;
147 public function statName(string $name, int $flags = 0): darray<arraykey, mixed>;
148 public function unchangeAll(): bool;
149 public function unchangeArchive(): bool;
150 public function unchangeIndex(int $index): bool;
151 public function unchangeName(string $name): bool;
156 * Close a ZIP file archive
159 function zip_close(resource $zip): void;
162 * Close a directory entry
165 function zip_entry_close(resource $zip_entry): bool;
168 * Retrieve the compressed size of a directory entry
171 function zip_entry_compressedsize(resource $zip_entry): int;
174 * Retrieve the compression method of a directory entry
177 function zip_entry_compressionmethod(resource $zip_entry): string;
180 * Retrieve the actual file size of a directory entry
183 function zip_entry_filesize(resource $zip_entry): int;
186 * Retrieve the name of a directory entry
189 function zip_entry_name(resource $zip_entry): string;
192 * Open a directory entry for reading
195 function zip_entry_open(resource $zip, resource $zip_entry, string $mode): bool;
198 * Read from an open directory entry
201 function zip_entry_read(resource $zip_entry, int $length = 1024): string;
204 * Open a ZIP file archive
207 function zip_open(string $filename): mixed; // resource or false
210 * Read next entry in a ZIP file archive
215 ): HH\FIXME\MISSING_RETURN_TYPE; // resource or false