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