-
Notifications
You must be signed in to change notification settings - Fork 7
/
Phar.php
2527 lines (2268 loc) · 84.1 KB
/
Phar.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
// Start of Phar v.2.0.2
/**
* The PharException class provides a phar-specific exception class
* for try/catch blocks.
* @link http://php.net/manual/en/class.pharexception.php
*/
class PharException extends Exception implements Throwable {
protected $message;
protected $code;
protected $file;
protected $line;
/**
* (PHP 5 >= 5.1.0, PHP 7)<br/>
* Clone the exception
* @link http://php.net/manual/en/exception.clone.php
* @return void No value is returned.
*/
final private function __clone() {}
/**
* (PHP 5 >= 5.1.0, PHP 7)<br/>
* Construct the exception
* @link http://php.net/manual/en/exception.construct.php
* @param string $message [optional] <p>
* The Exception message to throw.
* </p>
* @param int $code [optional] <p>
* The Exception code.
* </p>
* @param Throwable $previous [optional] <p>
* The previous exception used for the exception chaining.
* </p>
*/
public function __construct(string $message = "", int $code = 0, Throwable $previous = null) {}
public function __wakeup() {}
/**
* (PHP 5 >= 5.1.0, PHP 7)<br/>
* Gets the Exception message
* @link http://php.net/manual/en/exception.getmessage.php
* @return string the Exception message as a string.
*/
final public function getMessage(): string {}
/**
* (PHP 5 >= 5.1.0, PHP 7)<br/>
* Gets the Exception code
* @link http://php.net/manual/en/exception.getcode.php
* @return mixed the exception code as integer in
* <b>Exception</b> but possibly as other type in
* <b>Exception</b> descendants (for example as
* string in <b>PDOException</b>).
*/
final public function getCode() {}
/**
* (PHP 5 >= 5.1.0, PHP 7)<br/>
* Gets the file in which the exception occurred
* @link http://php.net/manual/en/exception.getfile.php
* @return string the filename in which the exception was created.
*/
final public function getFile(): string {}
/**
* (PHP 5 >= 5.1.0, PHP 7)<br/>
* Gets the line in which the exception occurred
* @link http://php.net/manual/en/exception.getline.php
* @return int the line number where the exception was created.
*/
final public function getLine(): int {}
/**
* (PHP 5 >= 5.1.0, PHP 7)<br/>
* Gets the stack trace
* @link http://php.net/manual/en/exception.gettrace.php
* @return array the Exception stack trace as an array.
*/
final public function getTrace(): array {}
/**
* (PHP 5 >= 5.3.0, PHP 7)<br/>
* Returns previous Exception
* @link http://php.net/manual/en/exception.getprevious.php
* @return Exception the previous <b>Exception</b> if available
* or <b>NULL</b> otherwise.
*/
final public function getPrevious(): Exception {}
/**
* (PHP 5 >= 5.1.0, PHP 7)<br/>
* Gets the stack trace as a string
* @link http://php.net/manual/en/exception.gettraceasstring.php
* @return string the Exception stack trace as a string.
*/
final public function getTraceAsString(): string {}
/**
* (PHP 5 >= 5.1.0, PHP 7)<br/>
* String representation of the exception
* @link http://php.net/manual/en/exception.tostring.php
* @return string the string representation of the exception.
*/
public function __toString(): string {}
}
/**
* The Phar class provides a high-level interface to accessing and creating
* phar archives.
* @link http://php.net/manual/en/class.phar.php
*/
class Phar extends RecursiveDirectoryIterator implements RecursiveIterator, SeekableIterator, Traversable, Iterator, Countable, ArrayAccess {
const CURRENT_MODE_MASK = 240;
const CURRENT_AS_PATHNAME = 32;
const CURRENT_AS_FILEINFO = 0;
const CURRENT_AS_SELF = 16;
const KEY_MODE_MASK = 3840;
const KEY_AS_PATHNAME = 0;
const FOLLOW_SYMLINKS = 512;
const KEY_AS_FILENAME = 256;
const NEW_CURRENT_AND_KEY = 256;
const OTHER_MODE_MASK = 12288;
const SKIP_DOTS = 4096;
const UNIX_PATHS = 8192;
const BZ2 = 8192;
const GZ = 4096;
const NONE = 0;
const PHAR = 1;
const TAR = 2;
const ZIP = 3;
const COMPRESSED = 61440;
const PHP = 0;
const PHPS = 1;
const MD5 = 1;
const OPENSSL = 16;
const SHA1 = 2;
const SHA256 = 3;
const SHA512 = 4;
/**
* (PHP >= 5.3.0, PECL phar >= 1.0.0)<br/>
* Construct a Phar archive object
* @link http://php.net/manual/en/phar.construct.php
* @param string $fname <p>
* Path to an existing Phar archive or to-be-created archive. The file name's
* extension must contain .phar.
* </p>
* @param int $flags [optional] <p>
* Flags to pass to parent class <b>RecursiveDirectoryIterator</b>.
* </p>
* @param string $alias [optional] <p>
* Alias with which this Phar archive should be referred to in calls to stream
* functionality.
* </p>
*/
public function __construct(string $fname, int $flags = null, string $alias = null) {}
public function __destruct() {}
/**
* (Unknown)<br/>
* Add an empty directory to the phar archive
* @link http://php.net/manual/en/phar.addemptydir.php
* @param string $dirname <p>
* The name of the empty directory to create in the phar archive
* </p>
* @return void no return value, exception is thrown on failure.
*/
public function addEmptyDir(string $dirname) {}
/**
* (Unknown)<br/>
* Add a file from the filesystem to the phar archive
* @link http://php.net/manual/en/phar.addfile.php
* @param string $file <p>
* Full or relative path to a file on disk to be added
* to the phar archive.
* </p>
* @param string $localname [optional] <p>
* Path that the file will be stored in the archive.
* </p>
* @return void no return value, exception is thrown on failure.
*/
public function addFile(string $file, string $localname = null) {}
/**
* (Unknown)<br/>
* Add a file from a string to the phar archive
* @link http://php.net/manual/en/phar.addfromstring.php
* @param string $localname <p>
* Path that the file will be stored in the archive.
* </p>
* @param string $contents <p>
* The file contents to store
* </p>
* @return void no return value, exception is thrown on failure.
*/
public function addFromString(string $localname, string $contents) {}
/**
* (PHP >= 5.3.0, PECL phar >= 2.0.0)<br/>
* Construct a phar archive from the files within a directory.
* @link http://php.net/manual/en/phar.buildfromdirectory.php
* @param string $base_dir <p>
* The full or relative path to the directory that contains all files
* to add to the archive.
* </p>
* @param string $regex [optional] <p>
* An optional pcre regular expression that is used to filter the
* list of files. Only file paths matching the regular expression
* will be included in the archive.
* </p>
* @return array <b>Phar::buildFromDirectory</b> returns an associative array
* mapping internal path of file to the full path of the file on the
* filesystem.
*/
public function buildFromDirectory(string $base_dir, string $regex = null): array {}
/**
* (PHP >= 5.3.0, PECL phar >= 2.0.0)<br/>
* Construct a phar archive from an iterator.
* @link http://php.net/manual/en/phar.buildfromiterator.php
* @param Iterator $iter <p>
* Any iterator that either associatively maps phar file to location or
* returns SplFileInfo objects
* </p>
* @param string $base_directory [optional] <p>
* For iterators that return SplFileInfo objects, the portion of each
* file's full path to remove when adding to the phar archive
* </p>
* @return array <b>Phar::buildFromIterator</b> returns an associative array
* mapping internal path of file to the full path of the file on the
* filesystem.
*/
public function buildFromIterator(Iterator $iter, string $base_directory = null): array {}
/**
* (PHP >= 5.3.0, PECL phar >= 2.0.0)<br/>
* Compresses all files in the current Phar archive
* @link http://php.net/manual/en/phar.compressfiles.php
* @param int $compression <p>
* Compression must be one of Phar::GZ,
* Phar::BZ2 to add compression, or Phar::NONE
* to remove compression.
* </p>
* @return void No value is returned.
*/
public function compressFiles(int $compression) {}
/**
* (PHP >= 5.3.0, PECL phar >= 2.0.0)<br/>
* Decompresses all files in the current Phar archive
* @link http://php.net/manual/en/phar.decompressfiles.php
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
public function decompressFiles(): bool {}
/**
* (PHP >= 5.3.0, PECL phar >= 2.0.0)<br/>
* Compresses the entire Phar archive using Gzip or Bzip2 compression
* @link http://php.net/manual/en/phar.compress.php
* @param int $compression <p>
* Compression must be one of Phar::GZ,
* Phar::BZ2 to add compression, or Phar::NONE
* to remove compression.
* </p>
* @param string $extension [optional] <p>
* By default, the extension is .phar.gz
* or .phar.bz2 for compressing phar archives, and
* .phar.tar.gz or .phar.tar.bz2 for
* compressing tar archives. For decompressing, the default file extensions
* are .phar and .phar.tar.
* </p>
* @return object a <b>Phar</b> object.
*/
public function compress(int $compression, string $extension = null) {}
/**
* (PHP >= 5.3.0, PECL phar >= 2.0.0)<br/>
* Decompresses the entire Phar archive
* @link http://php.net/manual/en/phar.decompress.php
* @param string $extension [optional] <p>
* For decompressing, the default file extensions
* are .phar and .phar.tar.
* Use this parameter to specify another file extension. Be aware
* that all executable phar archives must contain .phar
* in their filename.
* </p>
* @return object A <b>Phar</b> object is returned.
*/
public function decompress(string $extension = null) {}
/**
* (PHP >= 5.3.0, PECL phar >= 2.0.0)<br/>
* Convert a phar archive to another executable phar archive file format
* @link http://php.net/manual/en/phar.converttoexecutable.php
* @param int $format [optional] <p>
* This should be one of Phar::PHAR, Phar::TAR,
* or Phar::ZIP. If set to <b>NULL</b>, the existing file format
* will be preserved.
* </p>
* @param int $compression [optional] <p>
* This should be one of Phar::NONE for no whole-archive
* compression, Phar::GZ for zlib-based compression, and
* Phar::BZ2 for bzip-based compression.
* </p>
* @param string $extension [optional] <p>
* This parameter is used to override the default file extension for a
* converted archive. Note that all zip- and tar-based phar archives must contain
* .phar in their file extension in order to be processed as a
* phar archive.
* </p>
* <p>
* If converting to a phar-based archive, the default extensions are
* .phar, .phar.gz, or .phar.bz2
* depending on the specified compression. For tar-based phar archives, the
* default extensions are .phar.tar, .phar.tar.gz,
* and .phar.tar.bz2. For zip-based phar archives, the
* default extension is .phar.zip.
* </p>
* @return Phar The method returns a <b>Phar</b> object on success and throws an
* exception on failure.
*/
public function convertToExecutable(int $format = 9021976, int $compression = 9021976, string $extension = null): Phar {}
/**
* (PHP >= 5.3.0, PECL phar >= 2.0.0)<br/>
* Convert a phar archive to a non-executable tar or zip file
* @link http://php.net/manual/en/phar.converttodata.php
* @param int $format [optional] <p>
* This should be one of Phar::TAR
* or Phar::ZIP. If set to <b>NULL</b>, the existing file format
* will be preserved.
* </p>
* @param int $compression [optional] <p>
* This should be one of Phar::NONE for no whole-archive
* compression, Phar::GZ for zlib-based compression, and
* Phar::BZ2 for bzip-based compression.
* </p>
* @param string $extension [optional] <p>
* This parameter is used to override the default file extension for a
* converted archive. Note that .phar cannot be used
* anywhere in the filename for a non-executable tar or zip archive.
* </p>
* <p>
* If converting to a tar-based phar archive, the
* default extensions are .tar, .tar.gz,
* and .tar.bz2 depending on specified compression.
* For zip-based archives, the
* default extension is .zip.
* </p>
* @return PharData The method returns a <b>PharData</b> object on success and throws an
* exception on failure.
*/
public function convertToData(int $format = 9021976, int $compression = 9021976, string $extension = null): PharData {}
/**
* (PHP >= 5.3.0, PECL phar >= 2.0.0)<br/>
* Copy a file internal to the phar archive to another new file within the phar
* @link http://php.net/manual/en/phar.copy.php
* @param string $oldfile
* @param string $newfile
* @return bool returns <b>TRUE</b> on success, but it is safer to encase method call in a
* try/catch block and assume success if no exception is thrown.
*/
public function copy(string $oldfile, string $newfile): bool {}
/**
* (PHP >= 5.3.0, PECL phar >= 1.0.0)<br/>
* Returns the number of entries (files) in the Phar archive
* @link http://php.net/manual/en/phar.count.php
* @return int The number of files contained within this phar, or 0 (the number zero)
* if none.
*/
public function count(): int {}
/**
* (PHP >= 5.3.0, PECL phar >= 2.0.0)<br/>
* Delete a file within a phar archive
* @link http://php.net/manual/en/phar.delete.php
* @param string $entry <p>
* Path within an archive to the file to delete.
* </p>
* @return bool returns <b>TRUE</b> on success, but it is better to check for thrown exception,
* and assume success if none is thrown.
*/
public function delete(string $entry): bool {}
/**
* (PHP >= 5.3.0, PECL phar >= 1.2.0)<br/>
* Deletes the global metadata of the phar
* @link http://php.net/manual/en/phar.delmetadata.php
* @return bool returns <b>TRUE</b> on success, but it is better to check for thrown exception,
* and assume success if none is thrown.
*/
public function delMetadata(): bool {}
/**
* (Unknown)<br/>
* Extract the contents of a phar archive to a directory
* @link http://php.net/manual/en/phar.extractto.php
* @param string $pathto <p>
* Path within an archive to the file to delete.
* </p>
* @param string|array $files [optional] <p>
* The name of a file or directory to extract, or an array of files/directories to extract
* </p>
* @param bool $overwrite [optional] <p>
* Set to <b>TRUE</b> to enable overwriting existing files
* </p>
* @return bool returns <b>TRUE</b> on success, but it is better to check for thrown exception,
* and assume success if none is thrown.
*/
public function extractTo(string $pathto, $files = null, bool $overwrite = false): bool {}
public function getAlias() {}
public function getPath() {}
/**
* (PHP >= 5.3.0, PECL phar >= 1.0.0)<br/>
* Returns phar archive meta-data
* @link http://php.net/manual/en/phar.getmetadata.php
* @return mixed any PHP variable that can be serialized and is stored as meta-data for the Phar archive,
* or <b>NULL</b> if no meta-data is stored.
*/
public function getMetadata() {}
/**
* (PHP >= 5.3.0, PECL phar >= 1.0.0)<br/>
* Return whether phar was modified
* @link http://php.net/manual/en/phar.getmodified.php
* @return bool <b>TRUE</b> if the phar has been modified since opened, <b>FALSE</b> if not.
*/
public function getModified(): bool {}
/**
* (PHP >= 5.3.0, PECL phar >= 1.0.0)<br/>
* Return MD5/SHA1/SHA256/SHA512/OpenSSL signature of a Phar archive
* @link http://php.net/manual/en/phar.getsignature.php
* @return array Array with the opened archive's signature in hash key and MD5,
* SHA-1,
* SHA-256, SHA-512, or OpenSSL
* in hash_type. This signature is a hash calculated on the
* entire phar's contents, and may be used to verify the integrity of the archive.
* A valid signature is absolutely required of all executable phar archives if the
* phar.require_hash INI variable
* is set to true.
*/
public function getSignature(): array {}
/**
* (PHP >= 5.3.0, PECL phar >= 1.0.0)<br/>
* Return the PHP loader or bootstrap stub of a Phar archive
* @link http://php.net/manual/en/phar.getstub.php
* @return string a string containing the contents of the bootstrap loader (stub) of
* the current Phar archive.
*/
public function getStub(): string {}
/**
* (PHP >= 5.3.0, PECL phar >= 1.0.0)<br/>
* Return version info of Phar archive
* @link http://php.net/manual/en/phar.getversion.php
* @return string The opened archive's API version. This is not to be confused with
* the API version that the loaded phar extension will use to create
* new phars. Each Phar archive has the API version hard-coded into
* its manifest. See Phar file format
* documentation for more information.
*/
public function getVersion(): string {}
/**
* (PHP >= 5.3.0, PECL phar >= 1.2.0)<br/>
* Returns whether phar has global meta-data
* @link http://php.net/manual/en/phar.hasmetadata.php
* @return bool <b>TRUE</b> if meta-data has been set, and <b>FALSE</b> if not.
*/
public function hasMetadata(): bool {}
/**
* (PHP >= 5.3.0, PECL phar >= 1.0.0)<br/>
* Used to determine whether Phar write operations are being buffered, or are flushing directly to disk
* @link http://php.net/manual/en/phar.isbuffering.php
* @return bool <b>TRUE</b> if the write operations are being buffer, <b>FALSE</b> otherwise.
*/
public function isBuffering(): bool {}
/**
* (PHP >= 5.3.0, PECL phar >= 2.0.0)<br/>
* Returns Phar::GZ or PHAR::BZ2 if the entire phar archive is compressed (.tar.gz/tar.bz and so on)
* @link http://php.net/manual/en/phar.iscompressed.php
* @return mixed Phar::GZ, Phar::BZ2 or <b>FALSE</b>
*/
public function isCompressed() {}
/**
* (PHP >= 5.3.0, PECL phar >= 2.0.0)<br/>
* Returns true if the phar archive is based on the tar/phar/zip file format depending on the parameter
* @link http://php.net/manual/en/phar.isfileformat.php
* @param int $format <p>
* Either Phar::PHAR, Phar::TAR, or
* Phar::ZIP to test for the format of the archive.
* </p>
* @return bool <b>TRUE</b> if the phar archive matches the file format requested by the parameter
*/
public function isFileFormat(int $format): bool {}
/**
* (Unknown)<br/>
* Returns true if the phar archive can be modified
* @link http://php.net/manual/en/phar.iswritable.php
* @return bool <b>TRUE</b> if the phar archive can be modified
*/
public function isWritable(): bool {}
/**
* (PHP >= 5.3.0, PECL phar >= 1.0.0)<br/>
* determines whether a file exists in the phar
* @link http://php.net/manual/en/phar.offsetexists.php
* @param string $offset <p>
* The filename (relative path) to look for in a Phar.
* </p>
* @return bool <b>TRUE</b> if the file exists within the phar, or <b>FALSE</b> if not.
*/
public function offsetExists(string $offset): bool {}
/**
* (PHP >= 5.3.0, PECL phar >= 1.0.0)<br/>
* Gets a <b>PharFileInfo</b> object for a specific file
* @link http://php.net/manual/en/phar.offsetget.php
* @param string $offset <p>
* The filename (relative path) to look for in a Phar.
* </p>
* @return int A <b>PharFileInfo</b> object is returned that can be used to
* iterate over a file's contents or to retrieve information about the current file.
*/
public function offsetGet(string $offset): int {}
/**
* (PHP >= 5.3.0, PECL phar >= 1.0.0)<br/>
* set the contents of an internal file to those of an external file
* @link http://php.net/manual/en/phar.offsetset.php
* @param string $offset <p>
* The filename (relative path) to modify in a Phar.
* </p>
* @param string $value <p>
* Content of the file.
* </p>
* @return void No return values.
*/
public function offsetSet(string $offset, string $value) {}
/**
* (PHP >= 5.3.0, PECL phar >= 1.0.0)<br/>
* remove a file from a phar
* @link http://php.net/manual/en/phar.offsetunset.php
* @param string $offset <p>
* The filename (relative path) to modify in a Phar.
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
public function offsetUnset(string $offset): bool {}
/**
* (PHP >= 5.3.0, PECL phar >= 1.2.1)<br/>
* Set the alias for the Phar archive
* @link http://php.net/manual/en/phar.setalias.php
* @param string $alias <p>
* A shorthand string that this archive can be referred to in phar
* stream wrapper access.
* </p>
* @return bool
*/
public function setAlias(string $alias): bool {}
/**
* (Unknown)<br/>
* Used to set the PHP loader or bootstrap stub of a Phar archive to the default loader
* @link http://php.net/manual/en/phar.setdefaultstub.php
* @param string $index [optional] <p>
* Relative path within the phar archive to run if accessed on the command-line
* </p>
* @param string $webindex [optional] <p>
* Relative path within the phar archive to run if accessed through a web browser
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
public function setDefaultStub(string $index = null, string $webindex = null): bool {}
/**
* (PHP >= 5.3.0, PECL phar >= 1.0.0)<br/>
* Sets phar archive meta-data
* @link http://php.net/manual/en/phar.setmetadata.php
* @param mixed $metadata <p>
* Any PHP variable containing information to store that describes the phar archive
* </p>
* @return void No value is returned.
*/
public function setMetadata($metadata) {}
/**
* (PHP >= 5.3.0, PECL phar >= 1.1.0)<br/>
* set the signature algorithm for a phar and apply it.
* @link http://php.net/manual/en/phar.setsignaturealgorithm.php
* @param int $sigtype <p>
* One of Phar::MD5,
* Phar::SHA1, Phar::SHA256,
* Phar::SHA512, or Phar::OPENSSL
* </p>
* @param string $privatekey [optional] <p>
* The contents of an OpenSSL private key, as extracted from a certificate or
* OpenSSL key file:
* <code>
* $private = openssl_get_privatekey(file_get_contents('private.pem'));
* $pkey = '';
* openssl_pkey_export($private, $pkey);
* $p->setSignatureAlgorithm(Phar::OPENSSL, $pkey);
* </code>
* See phar introduction for instructions on
* naming and placement of the public key file.
* </p>
* @return void No value is returned.
*/
public function setSignatureAlgorithm(int $sigtype, string $privatekey = null) {}
/**
* (PHP >= 5.3.0, PECL phar >= 1.0.0)<br/>
* Used to set the PHP loader or bootstrap stub of a Phar archive
* @link http://php.net/manual/en/phar.setstub.php
* @param string $stub <p>
* A string or an open stream handle to use as the executable stub for this
* phar archive.
* </p>
* @param int $len [optional] <p>
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
public function setStub(string $stub, int $len = -1): bool {}
/**
* (PHP >= 5.3.0, PECL phar >= 1.0.0)<br/>
* Start buffering Phar write operations, do not modify the Phar object on disk
* @link http://php.net/manual/en/phar.startbuffering.php
* @return void No value is returned.
*/
public function startBuffering() {}
/**
* (PHP >= 5.3.0, PECL phar >= 1.0.0)<br/>
* Stop buffering write requests to the Phar archive, and save changes to disk
* @link http://php.net/manual/en/phar.stopbuffering.php
* @return void No value is returned.
*/
public function stopBuffering() {}
/**
* (PHP >= 5.3.0, PECL phar >= 1.0.0)<br/>
* Returns the api version
* @link http://php.net/manual/en/phar.apiversion.php
* @return string The API version string as in "1.0.0".
*/
final public static function apiVersion(): string {}
/**
* (PHP >= 5.3.0, PECL phar >= 1.0.0)<br/>
* Returns whether phar extension supports compression using either zlib or bzip2
* @link http://php.net/manual/en/phar.cancompress.php
* @param int $type [optional] <p>
* Either Phar::GZ or Phar::BZ2 can be
* used to test whether compression is possible with a specific compression
* algorithm (zlib or bzip2).
* </p>
* @return bool <b>TRUE</b> if compression/decompression is available, <b>FALSE</b> if not.
*/
final public static function canCompress(int $type = 0): bool {}
/**
* (PHP >= 5.3.0, PECL phar >= 1.0.0)<br/>
* Returns whether phar extension supports writing and creating phars
* @link http://php.net/manual/en/phar.canwrite.php
* @return bool <b>TRUE</b> if write access is enabled, <b>FALSE</b> if it is disabled.
*/
final public static function canWrite(): bool {}
/**
* (Unknown)<br/>
* Create a phar-file format specific stub
* @link http://php.net/manual/en/phar.createdefaultstub.php
* @param string $indexfile [optional]
* @param string $webindexfile [optional]
* @return string a string containing the contents of a customized bootstrap loader (stub)
* that allows the created Phar archive to work with or without the Phar extension
* enabled.
*/
final public static function createDefaultStub(string $indexfile = null, string $webindexfile = null): string {}
/**
* (PHP >= 5.3.0, PECL phar >= 1.2.0)<br/>
* Return array of supported compression algorithms
* @link http://php.net/manual/en/phar.getsupportedcompression.php
* @return array an array containing any of Phar::GZ or
* Phar::BZ2, depending on the availability of
* the zlib extension or the
* bz2 extension.
*/
final public static function getSupportedCompression(): array {}
/**
* (PHP >= 5.3.0, PECL phar >= 1.1.0)<br/>
* Return array of supported signature types
* @link http://php.net/manual/en/phar.getsupportedsignatures.php
* @return array an array containing any of MD5, SHA-1,
* SHA-256, SHA-512, or OpenSSL.
*/
final public static function getSupportedSignatures(): array {}
/**
* (PHP >= 5.3.0, PECL phar >= 2.0.0)<br/>
* instructs phar to intercept fopen, file_get_contents, opendir, and all of the stat-related functions
* @link http://php.net/manual/en/phar.interceptfilefuncs.php
* @return void
*/
final public static function interceptFileFuncs() {}
/**
* (PHP >= 5.3.0, PECL phar >= 1.2.0)<br/>
* Returns whether the given filename is a valid phar filename
* @link http://php.net/manual/en/phar.isvalidpharfilename.php
* @param string $filename <p>
* The name or full path to a phar archive not yet created
* </p>
* @param bool $executable [optional] <p>
* This parameter determines whether the filename should be treated as
* a phar executable archive, or a data non-executable archive
* </p>
* @return bool <b>TRUE</b> if the filename is valid, <b>FALSE</b> if not.
*/
final public static function isValidPharFilename(string $filename, bool $executable = true): bool {}
/**
* (PHP >= 5.3.0, PECL phar >= 1.0.0)<br/>
* Loads any phar archive with an alias
* @link http://php.net/manual/en/phar.loadphar.php
* @param string $filename <p>
* the full or relative path to the phar archive to open
* </p>
* @param string $alias [optional] <p>
* The alias that may be used to refer to the phar archive. Note
* that many phar archives specify an explicit alias inside the
* phar archive, and a <b>PharException</b> will be thrown if
* a new alias is specified in this case.
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
final public static function loadPhar(string $filename, string $alias = null): bool {}
/**
* (PHP >= 5.3.0, PECL phar >= 1.0.0)<br/>
* Reads the currently executed file (a phar) and registers its manifest
* @link http://php.net/manual/en/phar.mapphar.php
* @param string $alias [optional] <p>
* The alias that can be used in phar:// URLs to
* refer to this archive, rather than its full path.
* </p>
* @param int $dataoffset [optional] <p>
* Unused variable, here for compatibility with PEAR's PHP_Archive.
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
final public static function mapPhar(string $alias = null, int $dataoffset = 0): bool {}
/**
* (PHP >= 5.3.0, PECL phar >= 2.0.0)<br/>
* Returns the full path on disk or full phar URL to the currently executing Phar archive
* @link http://php.net/manual/en/phar.running.php
* @param bool $retphar [optional] <p>
* If <b>FALSE</b>, the full path on disk to the phar
* archive is returned. If <b>TRUE</b>, a full phar URL is returned.
* </p>
* @return string the filename if valid, empty string otherwise.
*/
final public static function running(bool $retphar = true): string {}
/**
* (PHP >= 5.3.0, PECL phar >= 2.0.0)<br/>
* Mount an external path or file to a virtual location within the phar archive
* @link http://php.net/manual/en/phar.mount.php
* @param string $pharpath <p>
* The internal path within the phar archive to use as the mounted path location.
* This must be a relative path within the phar archive, and must not already exist.
* </p>
* @param string $externalpath <p>
* A path or URL to an external file or directory to mount within the phar archive
* </p>
* @return void No return. <b>PharException</b> is thrown on failure.
*/
final public static function mount(string $pharpath, string $externalpath) {}
/**
* (Unknown)<br/>
* Defines a list of up to 4 $_SERVER variables that should be modified for execution
* @link http://php.net/manual/en/phar.mungserver.php
* @param array $munglist <p>
* an array containing as string indices any of
* REQUEST_URI, PHP_SELF,
* SCRIPT_NAME and SCRIPT_FILENAME.
* Other values trigger an exception, and <b>Phar::mungServer</b>
* is case-sensitive.
* </p>
* @return void No return.
*/
final public static function mungServer(array $munglist) {}
/**
* (PHP >= 5.3.0, PECL phar >= 2.0.0)<br/>
* Completely remove a phar archive from disk and from memory
* @link http://php.net/manual/en/phar.unlinkarchive.php
* @param string $archive <p>
* The path on disk to the phar archive.
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
final public static function unlinkArchive(string $archive): bool {}
/**
* (PHP >= 5.3.0, PECL phar >= 2.0.0)<br/>
* mapPhar for web-based phars. front controller for web applications
* @link http://php.net/manual/en/phar.webphar.php
* @param string $alias [optional] <p>
* The alias that can be used in phar:// URLs to
* refer to this archive, rather than its full path.
* </p>
* @param string $index [optional] <p>
* The location within the phar of the directory index.
* </p>
* @param string $f404 [optional] <p>
* The location of the script to run when a file is not found. This
* script should output the proper HTTP 404 headers.
* </p>
* @param array $mimetypes [optional] <p>
* An array mapping additional file extensions to MIME type.
* If the default mapping is sufficient, pass an empty array.
* By default, these extensions are mapped to these MIME types:
* <code>
* $mimes = array(
* 'phps' => Phar::PHPS, // pass to highlight_file()
* 'c' => 'text/plain',
* 'cc' => 'text/plain',
* 'cpp' => 'text/plain',
* 'c++' => 'text/plain',
* 'dtd' => 'text/plain',
* 'h' => 'text/plain',
* 'log' => 'text/plain',
* 'rng' => 'text/plain',
* 'txt' => 'text/plain',
* 'xsd' => 'text/plain',
* 'php' => Phar::PHP, // parse as PHP
* 'inc' => Phar::PHP, // parse as PHP
* 'avi' => 'video/avi',
* 'bmp' => 'image/bmp',
* 'css' => 'text/css',
* 'gif' => 'image/gif',
* 'htm' => 'text/html',
* 'html' => 'text/html',
* 'htmls' => 'text/html',
* 'ico' => 'image/x-ico',
* 'jpe' => 'image/jpeg',
* 'jpg' => 'image/jpeg',
* 'jpeg' => 'image/jpeg',
* 'js' => 'application/x-javascript',
* 'midi' => 'audio/midi',
* 'mid' => 'audio/midi',
* 'mod' => 'audio/mod',
* 'mov' => 'movie/quicktime',
* 'mp3' => 'audio/mp3',
* 'mpg' => 'video/mpeg',
* 'mpeg' => 'video/mpeg',
* 'pdf' => 'application/pdf',
* 'png' => 'image/png',
* 'swf' => 'application/shockwave-flash',
* 'tif' => 'image/tiff',
* 'tiff' => 'image/tiff',
* 'wav' => 'audio/wav',
* 'xbm' => 'image/xbm',
* 'xml' => 'text/xml',
* );
* </code>
* </p>
* @param callable $rewrites [optional] <p>
* The rewrites function is passed a string as its only parameter and must return a string or <b>FALSE</b>.
* </p>
* <p>
* If you are using fast-cgi or cgi then the parameter passed to the function is the value of the
* $_SERVER['PATH_INFO'] variable. Otherwise, the parameter passed to the function is the value
* of the $_SERVER['REQUEST_URI'] variable.
* </p>
* <p>
* If a string is returned it is used as the internal file path. If <b>FALSE</b> is returned then webPhar() will
* send a HTTP 403 Denied Code.
* </p>
* @return void No value is returned.
*/
final public static function webPhar(string $alias = null, string $index = "index.php", string $f404 = null, array $mimetypes = null, callable $rewrites = null) {}
/**
* (PHP 5, PHP 7)<br/>
* Returns whether current entry is a directory and not '.' or '..'
* @link http://php.net/manual/en/recursivedirectoryiterator.haschildren.php
* @param bool $allow_links [optional] <p>
* </p>
* @return bool whether the current entry is a directory, but not '.' or '..'
*/
public function hasChildren(bool $allow_links = false): bool {}
/**
* (PHP 5 >= 5.1.0, PHP 7)<br/>
* Returns an iterator for the current entry if it is a directory
* @link http://php.net/manual/en/recursivedirectoryiterator.getchildren.php
* @return mixed The filename, file information, or $this depending on the set flags.
* See the FilesystemIterator
* constants.
*/
public function getChildren() {}
/**
* (PHP 5 >= 5.1.0, PHP 7)<br/>
* Get sub path
* @link http://php.net/manual/en/recursivedirectoryiterator.getsubpath.php
* @return string The sub path (sub directory).
*/
public function getSubPath(): string {}
/**
* (PHP 5 >= 5.1.0, PHP 7)<br/>
* Get sub path and name
* @link http://php.net/manual/en/recursivedirectoryiterator.getsubpathname.php
* @return string The sub path (sub directory) and filename.
*/
public function getSubPathname(): string {}
/**
* (PHP 5 >= 5.3.0, PHP 7)<br/>
* Rewinds back to the beginning
* @link http://php.net/manual/en/filesystemiterator.rewind.php
* @return void No value is returned.
*/
public function rewind() {}
/**
* (PHP 5 >= 5.3.0, PHP 7)<br/>
* Move to the next file
* @link http://php.net/manual/en/filesystemiterator.next.php
* @return void No value is returned.
*/
public function next() {}
/**
* (PHP 5 >= 5.3.0, PHP 7)<br/>
* Retrieve the key for the current file
* @link http://php.net/manual/en/filesystemiterator.key.php
* @return string the pathname or filename depending on the set flags.
* See the FilesystemIterator constants.
*/
public function key(): string {}
/**
* (PHP 5 >= 5.3.0, PHP 7)<br/>
* The current file
* @link http://php.net/manual/en/filesystemiterator.current.php
* @return mixed The filename, file information, or $this depending on the set flags.
* See the FilesystemIterator constants.
*/
public function current() {}
/**
* (PHP 5 >= 5.3.0, PHP 7)<br/>
* Get the handling flags
* @link http://php.net/manual/en/filesystemiterator.getflags.php
* @return int The integer value of the set flags.
*/
public function getFlags(): int {}
/**
* (PHP 5 >= 5.3.0, PHP 7)<br/>
* Sets handling flags
* @link http://php.net/manual/en/filesystemiterator.setflags.php
* @param int $flags [optional] <p>
* The handling flags to set.
* See the FilesystemIterator constants.
* </p>
* @return void No value is returned.
*/