HH_IGNORE_ERROR All array literals in HHI files
[hiphop-php.git] / hphp / hack / hhi / stdlib / builtins_zip.hhi
blobb625867c3ae1d3b25663e28fc1d488e344df4bea
1 <?hh // decl /* -*- mode: php -*- */
2 /**
3  * Copyright (c) 2014, Facebook, Inc.
4  * All rights reserved.
5  *
6  * This source code is licensed under the MIT license found in the
7  * LICENSE file in the "hack" directory of this source tree.
8  *
9  */
11 class ZipArchive {
13   // Constants
14   const CHECKCONS = 4;
15   const OVERWRITE = 8;
16   const FL_NOCASE = 1;
17   const FL_NODIR = 2;
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;
23   const ER_RENAME = 2;
24   const ER_CLOSE = 3;
25   const ER_WRITE = 6;
26   const ER_ZIPCLOSED = 8;
27   const ER_NOENT = 9;
28   const ER_EXISTS = 10;
29   const ER_TMPOPEN = 12;
30   const ER_MEMORY = 14;
31   const ER_CHANGED = 15;
32   const ER_COMPNOTSUPP = 16;
33   const ER_INVAL = 18;
34   const ER_NOZIP = 19;
35   const ER_INTERNAL = 20;
36   const ER_INCONS = 21;
37   const ER_REMOVE = 22;
38   const ER_DELETED = 23;
39   const ER_ENCRNOTSUPP = 24;
40   const ER_RDONLY = 25;
41   const ER_NOPASSWD = 26;
42   const ER_WRONGPASSWD = 27;
43   const CM_DEFAULT = -1;
44   const CM_STORE = 0;
45   const CM_SHRINK = 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;
50   const CM_IMPLODE = 6;
51   const CM_DEFLATE = 8;
52   const CM_DEFLATE64 = 9;
53   const CM_PKWARE_IMPLODE = 10;
54   const CM_BZIP2 = 12;
55   const CM_TERSE = 18;
56   const CM_WAVPACK = 97;
57   const CREATE = 1;
58   const EXCL = 2;
59   const ER_OK = 0;
60   const ER_SEEK = 4;
61   const ER_READ = 5;
62   const ER_CRC = 7;
63   const ER_OPEN = 11;
64   const ER_ZLIB = 13;
65   const ER_EOF = 17;
66   const CM_LZMA = 14;
67   const CM_LZ77 = 19;
68   const CM_PPMD = 98;
70   // Properties
71   public int $status;
72   public int $statusSys;
73   public int $numFiles;
74   public string $filename;
75   public string $comment;
77   // Methods
78   public function __construct();
79   public function addEmptyDir(string $dirname): bool;
80   public function addFile(
81     string $filename,
82     string $localname = "",
83     int $start = 0,
84     int $length = 0,
85   ): bool;
86   public function addFromString(string $localname, string $contents): bool;
87   public function addGlob(
88     string $pattern,
89     int $flags = 0,
90     /* HH_IGNORE_ERROR[2083] */
91     array $options = array(),
92   ): bool;
93   public function addPattern(
94     string $pattern,
95     string $path = ".",
96     /* HH_IGNORE_ERROR[2083] */
97     array $options = array(),
98   ): bool;
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(
108     int $index,
109     int $length = 0,
110     int $flags = 0,
111   ): string;
112   public function getFromName(
113     string $name,
114     int $length = 0,
115     int $flags = 0,
116   ): string;
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(
128     int $index,
129     int $comp_method,
130     int $comp_flags = 0,
131   ): bool;
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
143  */
144 <<__PHPStdLib>>
145 function zip_close(resource $zip): void;
148  * Close a directory entry
149  */
150 <<__PHPStdLib>>
151 function zip_entry_close(resource $zip_entry): bool;
154  * Retrieve the compressed size of a directory entry
155  */
156 <<__PHPStdLib>>
157 function zip_entry_compressedsize(resource $zip_entry): int;
160  * Retrieve the compression method of a directory entry
161  */
162 <<__PHPStdLib>>
163 function zip_entry_compressionmethod(resource $zip_entry): string;
166  * Retrieve the actual file size of a directory entry
167  */
168 <<__PHPStdLib>>
169 function zip_entry_filesize(resource $zip_entry): int;
172  * Retrieve the name of a directory entry
173  */
174 <<__PHPStdLib>>
175 function zip_entry_name(resource $zip_entry): string;
178  * Open a directory entry for reading
179  */
180 <<__PHPStdLib>>
181 function zip_entry_open(
182   resource $zip,
183   resource $zip_entry,
184   string $mode,
185 ): bool;
188  * Read from an open directory entry
189  */
190 <<__PHPStdLib>>
191 function zip_entry_read(
192   resource $zip_entry,
193   int $length = 1024,
194 ): string;
197  * Open a ZIP file archive
198  */
199 <<__PHPStdLib>>
200 function zip_open(string $filename): mixed; // resource or false
203  * Read next entry in a ZIP file archive
204  */
205 <<__PHPStdLib>>
206 function zip_read(resource $zip); // resource or false