Download the PHP package gemorroj/archive7z without Composer
On this page you can find all versions of the php package gemorroj/archive7z. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package archive7z
Wrapper 7-zip
Features:
- Supports all 7-Zip formats:
- Packing / unpacking:
7z,XZ,BZIP2,GZIP,TAR,ZIPandWIM. - Unpacking only:
APFS,AR,ARJ,Base64,CAB,CHM,CPIO,CramFS,DMG,EXT,FAT,GPT,HFS,IHEX,ISO,LZH,LZMA,MBR,MSI,NSIS,NTFS,QCOW2,RAR,RPM,SquashFS,UDF,UEFI,VDI,VHD,VHDX,VMDK,XARandZ.
- Packing / unpacking:
- List files and directories
- Get contents of any file from archive
- Extract files and directories
- Create, add, rename and delete entries
- Password-protected archives (including encrypted file names for the
7zformat) - Solid archives, compression level and overwrite modes
- Decode legacy (non-UTF-8) entry names
Requirements:
- PHP >= 8.2 with proc_open enabled
- 7-Zip >= 16.04 (Windows), >= 21.01 (Linux), >= 21.02 (macOS) — official or a distribution package (
7zz/7z) - p7zip is not supported: no
@listfile/-scs, and the 17.x fork also lacks-aot
Installation:
Examples:
Open, validate and list
Read a file and extract
Create an archive
Modify an archive
Password-protected archives
Compression, solid mode and overwrite
Legacy (non-UTF-8) names
Names of old ZIP/TAR archives that carry no encoding metadata are detected by default; an explicit code page is only needed to pin the exact one.
Custom name decoding
Runtime options
Filename encodings:
Names are returned as UTF-8. How the names are read depends on the format and on the metadata it carries:
| Format | Name metadata | What happens |
|---|---|---|
7z, rar, wim |
Unicode-aware (7-Zip decodes them itself) | names come from the 7-Zip output; no fallback needed |
zip |
UTF-8 flag (bit 11) or Info-ZIP Unicode Path (0x7075) |
read from the container; used as UTF-8 |
zip |
none | raw bytes → decoded with fallbackEncoding |
tar |
PAX path record (UTF-8 by specification) |
read from the container as UTF-8 |
tar |
GNU/ustar header | raw bytes → decoded with fallbackEncoding |
gzip |
name in the header | read from the container |
| other | — | names come from the 7-Zip output |
For the formats without reliable metadata the code page is genuinely unknown, so
fallbackEncoding decides how the raw bytes are interpreted (default
detect()):
FallbackEncoding::detect()— guess from the listing (default); best effort, ranks the candidates by plausibility and leaves the bytes untouched when nothing is plausible.FallbackEncoding::codepage('CP866')— DOS code page; exact.FallbackEncoding::codepage('Windows-1251')— Windows Cyrillic; exact.FallbackEncoding::asIs()— leave the names untouched (opt out of detection).FallbackEncoding::viaCallback($decode, $encode)— your own mapping.
An explicit codepage(...) is the only mode that also passes a non-ASCII entry
name through a list file, so masks/paths with such names work everywhere; a
detect()/asIs()/viaCallback(...) mask goes on the 7-Zip command line and
matches only on builds comparing the raw bytes (official Linux 7zz).
Limitations:
zip/tar/gzipnames are read straight from the container (exact and cross-platform); other formats rely on 7-Zip's own output.- Legacy archives that store names without encoding metadata (old
zipwith 8-bit names, plaintar) are decoded by detecting the code page (default), which is a best effort: only the common code pages are tried, so an ambiguous or unsupported script can still be guessed wrong — pin acodepage(...)when the exact encoding is known, see #15.