The ZIP archives of ASiC containers (ETSI EN 319 162-1, 4.2): a writer of what a container needs, and a strict reader. The ZIP extension of PHP is not used: it is often missing, and it resolves what this reader refuses.
A seal covers the files of its container: the reader refuses whatever lets two tools see different files in the same archive, which general ZIP readers accept. A local header that differs from its central directory entry, bytes between entries, two names that look the same, a path that leaves the container: each is refused, not resolved one way or the other. Two names are the same when they are the same in Unicode normalization form C, if the intl extension of PHP is loaded (class Normalizer), and when they are the same bytes otherwise.
Neither ZIP64 nor encryption is supported, nor any method but stored (0) and deflate (8).
An entry read is an array: 'name' (its path, / separated), 'content'
(the uncompressed bytes), 'method' (0 or 8) and 'extra' (the extra field
of its local header).
| Methods | ||
|---|---|---|
public
static
|
write(array $inputs, int $modified): string
|
# |
public
static
|
read(string $archive, int $maxEntries = self::MAX_ENTRIES, int $maxTotalSize = self::MAX_TOTAL_SIZE): array
|
# |
| Constants | |||
|---|---|---|---|
public
|
MAX_ENTRIES = 1000
|
# | |
public
|
MAX_TOTAL_SIZE = 536870912
|
# | |
public
|
LOCAL_SIGNATURE = 0x04034b50
|
# | |
public
|
CENTRAL_SIGNATURE = 0x02014b50
|
# | |
public
|
END_SIGNATURE = 0x06054b50
|
# | |
public
|
DESCRIPTOR_SIGNATURE = 0x08074b50
|
# | |
public
|
LOCAL_SIZE = 30
|
# | |
public
|
CENTRAL_SIZE = 46
|
# | |
public
|
END_SIZE = 22
|
# | |
public
|
FLAG_DESCRIPTOR = 0x0008
|
# | |
public
|
FLAG_UTF8 = 0x0800
|
# | |
public
|
ALLOWED_FLAGS = 0x0006 | 0x0008 | 0x0800
|
# | |
public
|
REFUSED_EXTRA_IDS = [0x0001, 0x7075]
|
# | |
public
|
MAX_16 = 0xffff
|
# | |
public
|
MAX_32 = 0xffffffff
|
# | |