php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
php_zip.stub.php
Go to the documentation of this file.
1<?php
2
4
8#[\Deprecated(since: '8.0', message: 'use ZipArchive::open() instead')]
9function zip_open(string $filename) {}
10
14#[\Deprecated(since: '8.0', message: 'use ZipArchive::close() instead')]
15function zip_close($zip): void {}
16
21#[\Deprecated(since: '8.0', message: 'use ZipArchive::statIndex() instead')]
23
28#[\Deprecated(since: '8.0')]
29function zip_entry_open($zip_dp, $zip_entry, string $mode = "rb"): bool {}
30
34#[\Deprecated(since: '8.0')]
35function zip_entry_close($zip_entry): bool {}
36
40#[\Deprecated(since: '8.0', message: 'use ZipArchive::getFromIndex() instead')]
41function zip_entry_read($zip_entry, int $len = 1024): string|false {}
42
46#[\Deprecated(since: '8.0', message: 'use ZipArchive::statIndex() instead')]
47function zip_entry_name($zip_entry): string|false {}
48
52#[\Deprecated(since: '8.0', message: 'use ZipArchive::statIndex() instead')]
53function zip_entry_compressedsize($zip_entry): int|false {}
54
58#[\Deprecated(since: '8.0', message: 'use ZipArchive::statIndex() instead')]
59function zip_entry_filesize($zip_entry): int|false {}
60
64#[\Deprecated(since: '8.0', message: 'use ZipArchive::statIndex() instead')]
65function zip_entry_compressionmethod($zip_entry): string|false {}
66
67class ZipArchive implements Countable
68{
72 public const int CREATE = UNKNOWN;
76 public const int EXCL = UNKNOWN;
80 public const int CHECKCONS = UNKNOWN;
84 public const int OVERWRITE = UNKNOWN;
85#ifdef ZIP_RDONLY
89 public const int RDONLY = UNKNOWN;
90#endif
91
95 public const int FL_NOCASE = UNKNOWN;
99 public const int FL_NODIR = UNKNOWN;
103 public const int FL_COMPRESSED = UNKNOWN;
107 public const int FL_UNCHANGED = UNKNOWN;
108/* deprecated in libzip 1.10.0 */
109#ifdef ZIP_FL_RECOMPRESS
113 #[\Deprecated(since: '8.3')]
114 public const int FL_RECOMPRESS = UNKNOWN;
115#endif
119 public const int FL_ENCRYPTED = UNKNOWN;
123 public const int FL_OVERWRITE = UNKNOWN;
127 public const int FL_LOCAL = UNKNOWN;
131 public const int FL_CENTRAL = UNKNOWN;
132
133 /* Default filename encoding policy. */
134
138 public const int FL_ENC_GUESS = UNKNOWN;
142 public const int FL_ENC_RAW = UNKNOWN;
146 public const int FL_ENC_STRICT = UNKNOWN;
150 public const int FL_ENC_UTF_8 = UNKNOWN;
154 public const int FL_ENC_CP437 = UNKNOWN;
155
160 public const int FL_OPEN_FILE_NOW = UNKNOWN;
161
165 public const int CM_DEFAULT = UNKNOWN;
169 public const int CM_STORE = UNKNOWN;
173 public const int CM_SHRINK = UNKNOWN;
177 public const int CM_REDUCE_1 = UNKNOWN;
181 public const int CM_REDUCE_2 = UNKNOWN;
185 public const int CM_REDUCE_3 = UNKNOWN;
189 public const int CM_REDUCE_4 = UNKNOWN;
193 public const int CM_IMPLODE = UNKNOWN;
197 public const int CM_DEFLATE = UNKNOWN;
201 public const int CM_DEFLATE64 = UNKNOWN;
205 public const int CM_PKWARE_IMPLODE = UNKNOWN;
209 public const int CM_BZIP2 = UNKNOWN;
213 public const int CM_LZMA = UNKNOWN;
214#ifdef ZIP_CM_LZMA2
218 public const int CM_LZMA2 = UNKNOWN;
219#endif
220
221#ifdef ZIP_CM_ZSTD
225 public const int CM_ZSTD = UNKNOWN;
226#endif
227#ifdef ZIP_CM_XZ
231 public const int CM_XZ = UNKNOWN;
232#endif
236 public const int CM_TERSE = UNKNOWN;
240 public const int CM_LZ77 = UNKNOWN;
244 public const int CM_WAVPACK = UNKNOWN;
248 public const int CM_PPMD = UNKNOWN;
249
250 /* Error code */
251
256 public const int ER_OK = UNKNOWN;
261 public const int ER_MULTIDISK = UNKNOWN;
266 public const int ER_RENAME = UNKNOWN;
271 public const int ER_CLOSE = UNKNOWN;
276 public const int ER_SEEK = UNKNOWN;
281 public const int ER_READ = UNKNOWN;
286 public const int ER_WRITE = UNKNOWN;
291 public const int ER_CRC = UNKNOWN;
296 public const int ER_ZIPCLOSED = UNKNOWN;
301 public const int ER_NOENT = UNKNOWN;
306 public const int ER_EXISTS = UNKNOWN;
311 public const int ER_OPEN = UNKNOWN;
316 public const int ER_TMPOPEN = UNKNOWN;
321 public const int ER_ZLIB = UNKNOWN;
326 public const int ER_MEMORY = UNKNOWN;
331 public const int ER_CHANGED = UNKNOWN;
336 public const int ER_COMPNOTSUPP = UNKNOWN;
341 public const int ER_EOF = UNKNOWN;
346 public const int ER_INVAL = UNKNOWN;
351 public const int ER_NOZIP = UNKNOWN;
356 public const int ER_INTERNAL = UNKNOWN;
361 public const int ER_INCONS = UNKNOWN;
366 public const int ER_REMOVE = UNKNOWN;
371 public const int ER_DELETED = UNKNOWN;
376 public const int ER_ENCRNOTSUPP = UNKNOWN;
381 public const int ER_RDONLY = UNKNOWN;
386 public const int ER_NOPASSWD = UNKNOWN;
391 public const int ER_WRONGPASSWD = UNKNOWN;
392
393 /* since 1.0.0 */
394#ifdef ZIP_ER_OPNOTSUPP
399 public const int ER_OPNOTSUPP = UNKNOWN;
400#endif
401#ifdef ZIP_ER_INUSE
406 public const int ER_INUSE = UNKNOWN;
407#endif
408#ifdef ZIP_ER_TELL
413 public const int ER_TELL = UNKNOWN;
414#endif
415
416 /* since 1.6.0 */
417#ifdef ZIP_ER_COMPRESSED_DATA
422 public const int ER_COMPRESSED_DATA = UNKNOWN;
423#endif
424#ifdef ZIP_ER_CANCELLED
429 public const int ER_CANCELLED = UNKNOWN;
430#endif
431
432 /* since 1.10.0 */
433#ifdef ZIP_ER_DATA_LENGTH
438 public const int ER_DATA_LENGTH = UNKNOWN;
439#endif
440#ifdef ZIP_ER_NOT_ALLOWED
445 public const int ER_NOT_ALLOWED = UNKNOWN;
446#endif
447#ifdef ZIP_ER_TRUNCATED_ZIP
452 public const int ER_TRUNCATED_ZIP = UNKNOWN;
453#endif
454#ifdef ZIP_AFL_RDONLY
459 public const int AFL_RDONLY = UNKNOWN;
460#endif
461#ifdef ZIP_AFL_IS_TORRENTZIP
466 public const int AFL_IS_TORRENTZIP = UNKNOWN;
467#endif
468#ifdef ZIP_AFL_WANT_TORRENTZIP
473 public const int AFL_WANT_TORRENTZIP = UNKNOWN;
474#endif
475#ifdef ZIP_AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE
481#endif
482
483#ifdef ZIP_OPSYS_DEFAULT
488 public const int OPSYS_DOS = UNKNOWN;
493 public const int OPSYS_AMIGA = UNKNOWN;
498 public const int OPSYS_OPENVMS = UNKNOWN;
503 public const int OPSYS_UNIX = UNKNOWN;
508 public const int OPSYS_VM_CMS = UNKNOWN;
513 public const int OPSYS_ATARI_ST = UNKNOWN;
518 public const int OPSYS_OS_2 = UNKNOWN;
523 public const int OPSYS_MACINTOSH = UNKNOWN;
528 public const int OPSYS_Z_SYSTEM = UNKNOWN;
533 public const int OPSYS_CPM = UNKNOWN;
538 public const int OPSYS_WINDOWS_NTFS = UNKNOWN;
543 public const int OPSYS_MVS = UNKNOWN;
548 public const int OPSYS_VSE = UNKNOWN;
553 public const int OPSYS_ACORN_RISC = UNKNOWN;
558 public const int OPSYS_VFAT = UNKNOWN;
563 public const int OPSYS_ALTERNATE_MVS = UNKNOWN;
568 public const int OPSYS_BEOS = UNKNOWN;
573 public const int OPSYS_TANDEM = UNKNOWN;
578 public const int OPSYS_OS_400 = UNKNOWN;
583 public const int OPSYS_OS_X = UNKNOWN;
588 public const int OPSYS_DEFAULT = UNKNOWN;
589#endif
590
594 public const int EM_NONE = UNKNOWN;
598 public const int EM_TRAD_PKWARE = UNKNOWN;
599#ifdef HAVE_ENCRYPTION
603 public const int EM_AES_128 = UNKNOWN;
607 public const int EM_AES_192 = UNKNOWN;
611 public const int EM_AES_256 = UNKNOWN;
612#endif
616 public const int EM_UNKNOWN = UNKNOWN;
617
621 public const string LIBZIP_VERSION = UNKNOWN;
622
626 public const int LENGTH_TO_END = UNKNOWN;
627 /* since 1.10.1 */
628#ifdef ZIP_LENGTH_UNCHECKED
632 public const int LENGTH_UNCHECKED = UNKNOWN;
633#endif
634
636 public int $lastId;
638 public int $status;
640 public int $statusSys;
642 public int $numFiles;
644 public string $filename;
646 public string $comment;
647
649 public function open(string $filename, int $flags = 0): bool|int {}
650
654 public function setPassword(#[\SensitiveParameter] string $password): bool {}
655
657 public function close(): bool {}
658
660 public function count(): int {}
661
663 public function getStatusString(): string {}
664
666
668 public function addEmptyDir(string $dirname, int $flags = 0): bool {}
669
671 public function addFromString(string $name, string $content, int $flags = ZipArchive::FL_OVERWRITE): bool {}
672
674 public function addFile(string $filepath, string $entryname = "", int $start = 0, int $length = ZipArchive::LENGTH_TO_END, int $flags = ZipArchive::FL_OVERWRITE): bool {}
675
677 public function replaceFile(string $filepath, int $index, int $start = 0, int $length = ZipArchive::LENGTH_TO_END, int $flags = 0): bool {}
678
680 public function addGlob(string $pattern, int $flags = 0, array $options = []): array|false {}
681
683 public function addPattern(string $pattern, string $path = ".", array $options = []): array|false {}
684
686 public function renameIndex(int $index, string $new_name): bool {}
687
689 public function renameName(string $name, string $new_name): bool {}
690
692 public function setArchiveComment(string $comment): bool {}
693
695 public function getArchiveComment(int $flags = 0): string|false {}
696
697 public function setArchiveFlag(int $flag, int $value): bool {}
698
699 public function getArchiveFlag(int $flag, int $flags = 0): int {}
700
702 public function setCommentIndex(int $index, string $comment): bool {}
703
705 public function setCommentName(string $name, string $comment): bool {}
706
707#ifdef HAVE_SET_MTIME
709 public function setMtimeIndex(int $index, int $timestamp, int $flags = 0): bool {}
710
712 public function setMtimeName(string $name, int $timestamp, int $flags = 0): bool {}
713#endif
714
716 public function getCommentIndex(int $index, int $flags = 0): string|false {}
717
719 public function getCommentName(string $name, int $flags = 0): string|false {}
720
722 public function deleteIndex(int $index): bool {}
723
725 public function deleteName(string $name): bool {}
726
728 public function statName(string $name, int $flags = 0): array|false {}
729
731 public function statIndex(int $index, int $flags = 0): array|false {}
732
734 public function locateName(string $name, int $flags = 0): int|false {}
735
737 public function getNameIndex(int $index, int $flags = 0): string|false {}
738
740 public function unchangeArchive(): bool {}
741
743 public function unchangeAll(): bool {}
744
746 public function unchangeIndex(int $index): bool {}
747
749 public function unchangeName(string $name): bool {}
750
752 public function extractTo(string $pathto, array|string|null $files = null): bool {}
753
755 public function getFromName(string $name, int $len = 0, int $flags = 0): string|false {}
756
758 public function getFromIndex(int $index, int $len = 0, int $flags = 0): string|false {}
759
761 public function getStreamIndex(int $index, int $flags = 0) {}
762
764 public function getStreamName(string $name, int $flags = 0) {}
765
767 public function getStream(string $name) {}
768
769#ifdef ZIP_OPSYS_DEFAULT
771 public function setExternalAttributesName(string $name, int $opsys, int $attr, int $flags = 0): bool {}
772
774 public function setExternalAttributesIndex(int $index, int $opsys, int $attr, int $flags = 0): bool {}
775
781 public function getExternalAttributesName(string $name, &$opsys, &$attr, int $flags = 0): bool {}
782
788 public function getExternalAttributesIndex(int $index, &$opsys, &$attr, int $flags = 0): bool {}
789#endif
790
792 public function setCompressionName(string $name, int $method, int $compflags = 0): bool {}
793
795 public function setCompressionIndex(int $index, int $method, int $compflags = 0): bool {}
796
797#ifdef HAVE_ENCRYPTION
801 public function setEncryptionName(string $name, int $method, #[\SensitiveParameter] ?string $password = null): bool {}
802
806 public function setEncryptionIndex(int $index, int $method, #[\SensitiveParameter] ?string $password = null): bool {}
807#endif
808
809#ifdef HAVE_PROGRESS_CALLBACK
811 public function registerProgressCallback(float $rate, callable $callback): bool {}
812#endif
813
814#ifdef HAVE_CANCEL_CALLBACK
816 public function registerCancelCallback(callable $callback): bool {}
817#endif
818
819#ifdef HAVE_METHOD_SUPPORTED
820 public static function isCompressionMethodSupported(int $method, bool $enc = true): bool {}
821
822 public static function isEncryptionMethodSupported(int $method, bool $enc = true): bool {}
823#endif
824}
const int CM_LZMA
const int OPSYS_MACINTOSH
const int LENGTH_TO_END
const int EM_AES_192
const int OPSYS_OPENVMS
const int FL_ENCRYPTED
getStream(string $name)
const int OPSYS_OS_2
addPattern(string $pattern, string $path=".", array $options=[])
const int OPSYS_WINDOWS_NTFS
const int ER_CHANGED
const int ER_NOENT
const int ER_NOPASSWD
const int ER_COMPNOTSUPP
const int FL_LOCAL
deleteIndex(int $index)
setExternalAttributesName(string $name, int $opsys, int $attr, int $flags=0)
const int AFL_WANT_TORRENTZIP
const int FL_CENTRAL
const int FL_COMPRESSED
setEncryptionIndex(int $index, int $method, #[\SensitiveParameter] ?string $password=null)
const int ER_CRC
renameName(string $name, string $new_name)
const int OPSYS_VFAT
setCommentName(string $name, string $comment)
const int CM_DEFLATE64
registerCancelCallback(callable $callback)
const int OPSYS_DOS
const int FL_ENC_GUESS
const int ER_WRITE
const int FL_UNCHANGED
const int ER_DELETED
const int ER_REMOVE
getExternalAttributesName(string $name, &$opsys, &$attr, int $flags=0)
const int ER_INTERNAL
const int OPSYS_UNIX
const int LENGTH_UNCHECKED
const int FL_ENC_RAW
const int ER_TMPOPEN
getNameIndex(int $index, int $flags=0)
const int OPSYS_MVS
const int ER_EXISTS
const int ER_EOF
const int OPSYS_DEFAULT
const int CM_REDUCE_2
statName(string $name, int $flags=0)
const int ER_WRONGPASSWD
const int OPSYS_CPM
setCompressionIndex(int $index, int $method, int $compflags=0)
const int CM_STORE
const int CM_PKWARE_IMPLODE
const int FL_NODIR
const int ER_NOT_ALLOWED
getFromIndex(int $index, int $len=0, int $flags=0)
const int CM_TERSE
const int ER_INCONS
setPassword(#[\SensitiveParameter] string $password)
const int ER_CANCELLED
const int ER_NOZIP
const int ER_TRUNCATED_ZIP
const int ER_OK
const int CM_XZ
const int CM_LZMA2
getStreamName(string $name, int $flags=0)
const int EM_AES_128
locateName(string $name, int $flags=0)
unchangeName(string $name)
setCommentIndex(int $index, string $comment)
setExternalAttributesIndex(int $index, int $opsys, int $attr, int $flags=0)
const int OPSYS_OS_X
const int CM_DEFLATE
renameIndex(int $index, string $new_name)
const int ER_MULTIDISK
setMtimeIndex(int $index, int $timestamp, int $flags=0)
extractTo(string $pathto, array|string|null $files=null)
deleteName(string $name)
const int OPSYS_ACORN_RISC
const int ER_COMPRESSED_DATA
const int FL_ENC_UTF_8
const int OPSYS_ATARI_ST
getStreamIndex(int $index, int $flags=0)
const int CM_WAVPACK
const int OPSYS_VSE
const int OPSYS_Z_SYSTEM
const int FL_OPEN_FILE_NOW
replaceFile(string $filepath, int $index, int $start=0, int $length=ZipArchive::LENGTH_TO_END, int $flags=0)
unchangeIndex(int $index)
const int OVERWRITE
const int EM_AES_256
const int ER_TELL
const int OPSYS_ALTERNATE_MVS
const int ER_ENCRNOTSUPP
const int RDONLY
const int FL_ENC_CP437
string $filename
const int EM_UNKNOWN
static isCompressionMethodSupported(int $method, bool $enc=true)
const int ER_OPEN
setArchiveFlag(int $flag, int $value)
const int ER_OPNOTSUPP
setArchiveComment(string $comment)
getArchiveFlag(int $flag, int $flags=0)
const int EM_TRAD_PKWARE
const int ER_DATA_LENGTH
const int CM_REDUCE_1
const int ER_ZLIB
string $comment
const int CREATE
const int OPSYS_OS_400
const int CM_REDUCE_4
const int CM_SHRINK
const int ER_RDONLY
registerProgressCallback(float $rate, callable $callback)
const int AFL_IS_TORRENTZIP
const int CHECKCONS
const int CM_LZ77
const int EXCL
static isEncryptionMethodSupported(int $method, bool $enc=true)
open(string $filename, int $flags=0)
const int FL_NOCASE
const int ER_CLOSE
getCommentIndex(int $index, int $flags=0)
const string LIBZIP_VERSION
const int OPSYS_BEOS
const int CM_ZSTD
const int ER_SEEK
const int OPSYS_TANDEM
const int OPSYS_AMIGA
const int FL_ENC_STRICT
const int CM_DEFAULT
addGlob(string $pattern, int $flags=0, array $options=[])
setMtimeName(string $name, int $timestamp, int $flags=0)
getExternalAttributesIndex(int $index, &$opsys, &$attr, int $flags=0)
const int ER_RENAME
getCommentName(string $name, int $flags=0)
addFromString(string $name, string $content, int $flags=ZipArchive::FL_OVERWRITE)
const int ER_INVAL
const int CM_PPMD
addEmptyDir(string $dirname, int $flags=0)
const int ER_INUSE
getFromName(string $name, int $len=0, int $flags=0)
getArchiveComment(int $flags=0)
addFile(string $filepath, string $entryname="", int $start=0, int $length=ZipArchive::LENGTH_TO_END, int $flags=ZipArchive::FL_OVERWRITE)
const int ER_ZIPCLOSED
const int AFL_RDONLY
const int FL_OVERWRITE
const int FL_RECOMPRESS
const int AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE
const int OPSYS_VM_CMS
setCompressionName(string $name, int $method, int $compflags=0)
setEncryptionName(string $name, int $method, #[\SensitiveParameter] ?string $password=null)
const int ER_READ
const int CM_IMPLODE
statIndex(int $index, int $flags=0)
const int ER_MEMORY
const int EM_NONE
const int CM_BZIP2
const int CM_REDUCE_3
$filename
Definition create.php:9
$zip
Definition create.php:8
if(PHP_SAPI !='cli') if($argc< 1) $options
Definition ext_skel.php:376
$content
Definition fopen.php:20
zip_read($zip)
zip_open(string $filename)
zip_close($zip)
zip_entry_filesize($zip_entry)
zip_entry_compressedsize($zip_entry)
zip_entry_compressionmethod($zip_entry)
zip_entry_open($zip_dp, $zip_entry, string $mode="rb")
zip_entry_name($zip_entry)
zip_entry_close($zip_entry)
zip_entry_read($zip_entry, int $len=1024)
$files
Definition ucgendat.php:59
ZEND_API void(ZEND_FASTCALL *zend_touch_vm_stack_data)(void *vm_stack_data)
function(EX_VAR(opline->result.var))