ZipOption uses ConstantsTrait
Enumeration of the option keys accepted by the `oihana\files\archive\zip` helpers ({@see \oihana\files\archive\zip\zip()}, {@see \oihana\files\archive\zip\zipDirectory()} and {@see \oihana\files\archive\zip\unzip()}).
Tags
Table of Contents
Constants
- COMPRESSION : string = 'compression'
- Compression method applied to each entry when creating an archive.
- DRY_RUN : string = 'dryRun'
- Return the list of entries instead of extracting them.
- EXCLUDE : string = 'exclude'
- List of glob patterns or file names to exclude.
- FILTER : string = 'filter'
- Filter the files or directories to archive with a function (string $filepath): bool
- KEEP_PERMISSIONS : string = 'keepPermissions'
- Keep the Unix permissions of the files/directories.
- MAX_ENTRIES : string = 'maxEntries'
- Maximum number of entries allowed in the archive (decompression-bomb guard).
- MAX_SIZE : string = 'maxSize'
- Maximum total uncompressed size in bytes accepted during extraction (decompression-bomb guard).
- METADATA : string = 'metadata'
- Additional metadata to include in `.metadata.json`
- OVERWRITE : string = 'overwrite'
- Whether an existing target file may be overwritten.
Constants
COMPRESSION
Compression method applied to each entry when creating an archive.
public
string
COMPRESSION
= 'compression'
Accepts CompressionType::ZIP (DEFLATE, the default) or CompressionType::NONE (stored, no compression).
DRY_RUN
Return the list of entries instead of extracting them.
public
string
DRY_RUN
= 'dryRun'
EXCLUDE
List of glob patterns or file names to exclude.
public
string
EXCLUDE
= 'exclude'
FILTER
Filter the files or directories to archive with a function (string $filepath): bool
public
string
FILTER
= 'filter'
KEEP_PERMISSIONS
Keep the Unix permissions of the files/directories.
public
string
KEEP_PERMISSIONS
= 'keepPermissions'
MAX_ENTRIES
Maximum number of entries allowed in the archive (decompression-bomb guard).
public
string
MAX_ENTRIES
= 'maxEntries'
When set to a positive integer, unzip() rejects
archives that declare more entries than this limit, before extracting anything.
Default: null — no limit.
MAX_SIZE
Maximum total uncompressed size in bytes accepted during extraction (decompression-bomb guard).
public
string
MAX_SIZE
= 'maxSize'
When set to a positive integer, unzip() pre-scans the
archive and aborts if the sum of the entries' uncompressed sizes exceeds this limit,
before any file is written to disk. Default: null — no limit.
METADATA
Additional metadata to include in `.metadata.json`
public
string
METADATA
= 'metadata'
OVERWRITE
Whether an existing target file may be overwritten.
public
string
OVERWRITE
= 'overwrite'