xref: /PHP-8.0/ext/phar/phar_object.stub.php (revision 0d0c9aca)
1<?php
2
3/** @generate-function-entries */
4
5class PharException extends Exception
6{
7}
8
9class Phar extends RecursiveDirectoryIterator implements Countable, ArrayAccess
10{
11    public function __construct(string $filename, int $flags = FilesystemIterator::SKIP_DOTS|FilesystemIterator::UNIX_PATHS, ?string $alias = null) {}
12
13    public function __destruct() {}
14
15    /** @return void */
16    public function addEmptyDir(string $directory) {}
17
18    /** @return void */
19    public function addFile(string $filename, ?string $localName = null) {}
20
21    /** @return void */
22    public function addFromString(string $localName, string $contents) {}
23
24    /** @return array|false */
25    public function buildFromDirectory(string $directory, string $pattern = "") {}
26
27    /** @return array|false */
28    public function buildFromIterator(Traversable $iterator, ?string $baseDirectory = null) {}
29
30    /** @return void */
31    public function compressFiles(int $compression) {}
32
33    /** @return bool */
34    public function decompressFiles() {}
35
36    /** @return Phar|null */
37    public function compress(int $compression, ?string $extension = null) {}
38
39    /** @return Phar|null */
40    public function decompress(?string $extension = null) {}
41
42    /** @return Phar|null */
43    public function convertToExecutable(?int $format = null, ?int $compression = null, ?string $extension = null) {}
44
45    /** @return PharData|null */
46    public function convertToData(?int $format = null, ?int $compression = null, ?string $extension = null) {}
47
48    /** @return bool */
49    public function copy(string $from, string $to) {}
50
51    /** @return int */
52    public function count(int $mode = COUNT_NORMAL) {}
53
54    /** @return bool */
55    public function delete(string $localName) {}
56
57    /** @return bool */
58    public function delMetadata() {}
59
60    /** @return bool */
61    public function extractTo(string $directory, array|string|null $files = null, bool $overwrite = false) {}
62
63    /** @return string|null */
64    public function getAlias() {}
65
66    /** @return string */
67    public function getPath() {}
68
69    /** @return mixed */
70    public function getMetadata(array $unserializeOptions = []) {}
71
72    /** @return bool */
73    public function getModified() {}
74
75    /** @return array|false */
76    public function getSignature() {}
77
78    /** @return string */
79    public function getStub() {}
80
81    /** @return string */
82    public function getVersion() {}
83
84    /** @return bool */
85    public function hasMetadata() {}
86
87    /** @return bool */
88    public function isBuffering() {}
89
90    /** @return int|false */
91    public function isCompressed() {}
92
93    /** @return bool */
94    public function isFileFormat(int $format) {}
95
96    /** @return bool */
97    public function isWritable() {}
98
99    /**
100     * @param string $localName
101     * @return bool
102     */
103    public function offsetExists($localName) {}
104
105    /**
106     * @param string $localName
107     * @return PharFileInfo
108     */
109    public function offsetGet($localName) {}
110
111    /**
112     * @param string $localName
113     * @param resource|string $value
114     * @return void
115     */
116    public function offsetSet($localName, $value) {}
117
118    /**
119     * @param string $localName
120     * @return bool
121     */
122    public function offsetUnset($localName) {}
123
124    /** @return bool */
125    public function setAlias(string $alias) {}
126
127    /** @return bool */
128    public function setDefaultStub(?string $index = null, ?string $webIndex = null) {}
129
130    /** @return void */
131    public function setMetadata(mixed $metadata) {}
132
133    /** @return void */
134    public function setSignatureAlgorithm(int $algo, ?string $privateKey = null) {}
135
136    /**
137     * @param resource|string $stub
138     * @return bool
139     */
140    public function setStub($stub, int $length = UNKNOWN) {}
141
142    /** @return void */
143    public function startBuffering() {}
144
145    /** @return void */
146    public function stopBuffering() {}
147
148    final public static function apiVersion(): string {}
149
150    final public static function canCompress(int $compression = 0): bool {}
151
152    final public static function canWrite(): bool {}
153
154    final public static function createDefaultStub(?string $index = null, ?string $webIndex = null): string {}
155
156    final public static function getSupportedCompression(): array {}
157
158    final public static function getSupportedSignatures(): array {}
159
160    final public static function interceptFileFuncs(): void {}
161
162    final public static function isValidPharFilename(string $filename, bool $executable = true): bool {}
163
164    final public static function loadPhar(string $filename, ?string $alias = null): bool {}
165
166    final public static function mapPhar(?string $alias = null, int $offset = 0): bool {}
167
168    final public static function running(bool $returnPhar = true): string {}
169
170    final public static function mount(string $pharPath, string $externalPath): void {}
171
172    final public static function mungServer(array $variables): void {}
173
174    final public static function unlinkArchive(string $filename): bool {}
175
176    final public static function webPhar(
177        ?string $alias = null, ?string $index = null, ?string $fileNotFoundScript = null,
178        array $mimeTypes = [], ?callable $rewrite = null): void {}
179}
180
181class PharData extends RecursiveDirectoryIterator implements Countable, ArrayAccess
182{
183    /** @implementation-alias Phar::__construct */
184    public function __construct(string $filename, int $flags = FilesystemIterator::SKIP_DOTS|FilesystemIterator::UNIX_PATHS, ?string $alias = null, int $format = 0) {}
185
186    /** @implementation-alias Phar::__destruct */
187    public function __destruct() {}
188
189    /**
190     * @return void
191     * @implementation-alias Phar::addEmptyDir
192     */
193    public function addEmptyDir(string $directory) {}
194
195    /**
196     * @return void
197     * @implementation-alias Phar::addFile
198     */
199    public function addFile(string $filename, ?string $localName = null) {}
200
201    /**
202     * @return void
203     * @implementation-alias Phar::addFromString
204     */
205    public function addFromString(string $localName, string $contents) {}
206
207    /**
208     * @return array|false
209     * @implementation-alias Phar::buildFromDirectory
210     */
211    public function buildFromDirectory(string $directory, string $pattern = "") {}
212
213    /**
214     * @return array|false
215     * @implementation-alias Phar::buildFromIterator
216     */
217    public function buildFromIterator(Traversable $iterator, ?string $baseDirectory = null) {}
218
219    /**
220     * @return void
221     * @implementation-alias Phar::compressFiles
222     */
223    public function compressFiles(int $compression) {}
224
225    /**
226     * @return bool
227     * @implementation-alias Phar::decompressFiles
228     */
229    public function decompressFiles() {}
230
231    /**
232     * @return PharData|null
233     * @implementation-alias Phar::compress
234     * @no-verify
235     */
236    public function compress(int $compression, ?string $extension = null) {}
237
238    /**
239     * @return PharData|null
240     * @implementation-alias Phar::decompress
241     * @no-verify
242     */
243    public function decompress(?string $extension = null) {}
244
245    /**
246     * @return Phar|null
247     * @implementation-alias Phar::convertToExecutable
248     */
249    public function convertToExecutable(?int $format = null, ?int $compression = null, ?string $extension = null) {}
250
251    /**
252     * @return PharData|null
253     * @implementation-alias Phar::convertToData
254     */
255    public function convertToData(?int $format = null, ?int $compression = null, ?string $extension = null) {}
256
257    /**
258     * @return bool
259     * @implementation-alias Phar::copy
260     */
261    public function copy(string $from, string $to) {}
262
263    /**
264     * @return int
265     * @implementation-alias Phar::count
266     */
267    public function count(int $mode = COUNT_NORMAL) {}
268
269    /**
270     * @return bool
271     * @implementation-alias Phar::delete
272     */
273    public function delete(string $localName) {}
274
275    /**
276     * @return bool
277     * @implementation-alias Phar::delMetadata
278     */
279    public function delMetadata() {}
280
281    /**
282     * @return bool
283     * @implementation-alias Phar::extractTo
284     */
285    public function extractTo(string $directory, array|string|null $files = null, bool $overwrite = false) {}
286
287    /**
288     * @return string|null
289     * @implementation-alias Phar::getAlias
290     */
291    public function getAlias() {}
292
293    /**
294     * @return string
295     * @implementation-alias Phar::getPath
296     */
297    public function getPath() {}
298
299    /**
300     * @return mixed
301     * @implementation-alias Phar::getMetadata
302     */
303    public function getMetadata(array $unserializeOptions = []) {}
304
305    /**
306     * @return bool
307     * @implementation-alias Phar::getModified
308     */
309    public function getModified() {}
310
311    /**
312     * @return array|false
313     * @implementation-alias Phar::getSignature
314     */
315    public function getSignature() {}
316
317    /**
318     * @return string
319     * @implementation-alias Phar::getStub
320     */
321    public function getStub() {}
322
323    /**
324     * @return string
325     * @implementation-alias Phar::getVersion
326     */
327    public function getVersion() {}
328
329    /**
330     * @return bool
331     * @implementation-alias Phar::hasMetadata
332     */
333    public function hasMetadata() {}
334
335    /**
336     * @return bool
337     * @implementation-alias Phar::isBuffering
338     */
339    public function isBuffering() {}
340
341    /**
342     * @return int|false
343     * @implementation-alias Phar::isCompressed
344     */
345    public function isCompressed() {}
346
347    /**
348     * @return bool
349     * @implementation-alias Phar::isFileFormat
350     */
351    public function isFileFormat(int $format) {}
352
353    /**
354     * @return bool
355     * @implementation-alias Phar::isWritable
356     */
357    public function isWritable() {}
358
359    /**
360     * @param string $localName
361     * @return bool
362     * @implementation-alias Phar::offsetExists
363     */
364    public function offsetExists($localName) {}
365
366    /**
367     * @param string $localName
368     * @return PharFileInfo
369     * @implementation-alias Phar::offsetGet
370     */
371    public function offsetGet($localName) {}
372
373    /**
374     * @param string $localName
375     * @param resource|string $value
376     * @return void
377     * @implementation-alias Phar::offsetSet
378     */
379    public function offsetSet($localName, $value) {}
380
381    /**
382     * @param string $localName
383     * @return bool
384     * @implementation-alias Phar::offsetUnset
385     */
386    public function offsetUnset($localName) {}
387
388    /**
389     * @return bool
390     * @implementation-alias Phar::setAlias
391     */
392    public function setAlias(string $alias) {}
393
394    /**
395     * @return bool
396     * @implementation-alias Phar::setDefaultStub
397     */
398    public function setDefaultStub(?string $index = null, ?string $webIndex = null) {}
399
400    /**
401     * @return void
402     * @implementation-alias Phar::setMetadata
403     */
404    public function setMetadata(mixed $metadata) {}
405
406    /**
407     * @return void
408     * @implementation-alias Phar::setSignatureAlgorithm
409     */
410    public function setSignatureAlgorithm(int $algo, ?string $privateKey = null) {}
411
412    /**
413     * @param resource|string $stub
414     * @return bool
415     * @implementation-alias Phar::setStub
416     */
417    public function setStub($stub, int $length = UNKNOWN) {}
418
419    /**
420     * @return void
421     * @implementation-alias Phar::startBuffering
422     */
423    public function startBuffering() {}
424
425    /**
426     * @return void
427     * @implementation-alias Phar::stopBuffering
428     */
429    public function stopBuffering() {}
430
431    /** @implementation-alias Phar::apiVersion */
432    final public static function apiVersion(): string {}
433
434    /** @implementation-alias Phar::canCompress */
435    final public static function canCompress(int $compression = 0): bool {}
436
437    /** @implementation-alias Phar::canWrite */
438    final public static function canWrite(): bool {}
439
440    /** @implementation-alias Phar::createDefaultStub */
441    final public static function createDefaultStub(?string $index = null, ?string $webIndex = null): string {}
442
443    /** @implementation-alias Phar::getSupportedCompression */
444    final public static function getSupportedCompression(): array {}
445
446    /** @implementation-alias Phar::getSupportedSignatures */
447    final public static function getSupportedSignatures(): array {}
448
449    /** @implementation-alias Phar::interceptFileFuncs */
450    final public static function interceptFileFuncs(): void {}
451
452    /** @implementation-alias Phar::isValidPharFilename */
453    final public static function isValidPharFilename(string $filename, bool $executable = true): bool {}
454
455    /** @implementation-alias Phar::loadPhar */
456    final public static function loadPhar(string $filename, ?string $alias = null): bool {}
457
458    /** @implementation-alias Phar::mapPhar */
459    final public static function mapPhar(?string $alias = null, int $offset = 0): bool {}
460
461    /** @implementation-alias Phar::running */
462    final public static function running(bool $returnPhar = true): string {}
463
464    /** @implementation-alias Phar::mount */
465    final public static function mount(string $pharPath, string $externalPath): void {}
466
467    /** @implementation-alias Phar::mungServer */
468    final public static function mungServer(array $variables): void {}
469
470    /** @implementation-alias Phar::unlinkArchive */
471    final public static function unlinkArchive(string $filename): bool {}
472
473    /** @implementation-alias Phar::webPhar */
474    final public static function webPhar(
475        ?string $alias = null, ?string $index = null, ?string $fileNotFoundScript = null,
476        array $mimeTypes = [], ?callable $rewrite = null): void {}
477}
478
479class PharFileInfo extends SplFileInfo
480{
481    public function __construct(string $filename) {}
482
483    public function __destruct() {}
484
485    /** @return void */
486    public function chmod(int $perms) {}
487
488    /** @return bool */
489    public function compress(int $compression) {}
490
491    /** @return bool */
492    public function decompress() {}
493
494    /** @return bool */
495    public function delMetadata() {}
496
497    /** @return int */
498    public function getCompressedSize() {}
499
500    /** @return int */
501    public function getCRC32() {}
502
503    /** @return string */
504    public function getContent() {}
505
506    /** @return mixed */
507    public function getMetadata(array $unserializeOptions = []) {}
508
509    /** @return int */
510    public function getPharFlags() {}
511
512    /** @return bool */
513    public function hasMetadata() {}
514
515    /** @return bool */
516    public function isCompressed(?int $compression = null) {}
517
518    /** @return bool */
519    public function isCRCChecked() {}
520
521    /** @return void */
522    public function setMetadata(mixed $metadata) {}
523}
524