Zum Hauptinhalt springen

Zymba Documentation

ZIP.Archive

object @ZIP.Archive(@Base) {
COMPRESS_DEFAULT;
COMPRESS_STORE;
COMPRESS_SHRINK;
COMPRESS_REDUCE1;
COMPRESS_REDUCE2;
COMPRESS_REDUCE3;
COMPRESS_REDUCE4;
COMPRESS_IMPLODE;
COMPRESS_DEFLATE;
COMPRESS_DEFLATE64;
COMPRESS_PKWARE;
COMPRESS_BZIP2;
COMPRESS_LZMA;
COMPRESS_TERSE;
COMPRESS_LZ77;
COMPRESS_LZMA;
COMPRESS_ZSTD;
COMPRESS_MP3;
COMPRESS_XZ;
COMPRESS_JPEG;
COMPRESS_WAVPACK;
COMPRESS_PPMD;
ENCRYPT_NONE;
ENCRYPT_PKWARE;
ENCRYPT_AES128;
ENCRYPT_AES128;
ENCRYPT_AES128;
ENCRYPT_UNKNOWN;
MODE_READ;
MODE_WRITE;
MODE_CREATE;
MODE_TRUNCATE;
MODE_OVERWRITE;
construct(string $path, int $mode) {}
addDirectory(string $path, string $prefix): $this {}
addFile(string $path, string $name): $this {}
close() {}
countEntries(): int {}
crc32(string $name): int {}
createDirectory(string $name): $this {}
delete(string $name): $this {}
exists(string $name): bool {}
exit(mixed $exception) {}
extract(object $entries, string $path): $this {}
extractAll(string $path): $this {}
getComment(string $name): string {}
getCompression(string $name): int {}
getLastModified(string $name): int {}
getSize(string $name): int {}
getSizeRaw(string $name): int {}
listEntries(): object {}
move(string $name, string $target): $this {}
read(string $name, ?int $length): string {}
readRaw(string $name): string {}
restore(string $name): $this {}
rollback(): $this {}
selectStream(string $name): object {}
setComment(string $name, string $comment): $this {}
setCompression(string $name, int $method, int $flags): $this {}
setEncryption(string $name, int $method, ?string $password): $this {}
setLastModified(string $name, ?int $timestamp): $this {}
setPassword(string $password): $this {}
write(string $name, string $string): $this {}
}

ZIP archive prototype.

Prototype

Base

Methods

Opens a ZIP archive in a specific access mode (see MODE_* constants).

$this.construct(string $path, int $mode): void
Parameters
NameTypeValueDefault
pathstring""
modeintMODE_READ
$this.addDirectory(string $path, string $prefix): this
Parameters
NameTypeValueDefault
pathstring""
prefixstring""
Returns
TypeValue
$this
$this.addFile(string $path, string $name): this
Parameters
NameTypeValueDefault
pathstring""
namestringderived from path
Returns
TypeValue
$this

Closes this archive and frees its associated resources.

$this.close(): void
$this.countEntries(): int
Returns
TypeValue
int
$this.crc32(string $name): int
Parameters
NameTypeValueDefault
namestring""
Returns
TypeValue
int
$this.createDirectory(string $name): this
Parameters
NameTypeValueDefault
namestring""
Returns
TypeValue
$this
$this.delete(string $name): this
Parameters
NameTypeValueDefault
namestring""
Returns
TypeValue
$this
$this.exists(string $name): bool
Parameters
NameTypeValueDefault
namestring""
Returns
TypeValue
bool

Closes this archive, rolls it back on failure and frees its associated resources for the purpose of contextualization.

$this.exit(mixed $exception): void
Parameters
NameTypeValueDefault
exceptionmixednull
$this.extract(object $entries, string $path): this
Parameters
NameTypeValueDefault
entriesobject[name, ...][]
pathstring""
Returns
TypeValue
$this
$this.extractAll(string $path): this
Parameters
NameTypeValueDefault
pathstring""
Returns
TypeValue
$this
$this.getComment(string $name): string
Parameters
NameTypeValueDefault
namestring""
Returns
TypeValue
string
$this.getCompression(string $name): int
Parameters
NameTypeValueDefault
namestring""
Returns
TypeValue
int
$this.getLastModified(string $name): int
Parameters
NameTypeValueDefault
namestring""
Returns
TypeValue
int
$this.getSize(string $name): int
Parameters
NameTypeValueDefault
namestring""
Returns
TypeValue
int
$this.getSizeRaw(string $name): int
Parameters
NameTypeValueDefault
namestring""
Returns
TypeValue
int
$this.listEntries(): object
Returns
TypeValue
object[name, ...]
$this.move(string $name, string $target): this
Parameters
NameTypeValueDefault
namestring""
targetstring""
Returns
TypeValue
$this
$this.read(string $name, ?int $length): string
Parameters
NameTypeValueDefault
namestring""
length?intmaximum length
Returns
TypeValue
string
$this.readRaw(string $name): string
Parameters
NameTypeValueDefault
namestring""
Returns
TypeValue
string
$this.restore(string $name): this
Parameters
NameTypeValueDefault
namestring""
Returns
TypeValue
$this

Rolls back this archive by discarding all changes.

$this.rollback(): this
Returns
TypeValue
$this
$this.selectStream(string $name): @IO.Stream
Parameters
NameTypeValueDefault
namestring""
Returns
TypeValue
@IO.Stream
$this.setComment(string $name, string $comment): this
Parameters
NameTypeValueDefault
namestring""
commentstring""
Returns
TypeValue
$this
$this.setCompression(string $name, int $method, int $flags): this
Parameters
NameTypeValueDefault
namestring""
methodintCOMPRESS_DEFAULT
flagsint0
Returns
TypeValue
$this
$this.setEncryption(string $name, int $method, ?string $password): this
Parameters
NameTypeValueDefault
namestring""
methodintENCRYPT_NONE
password?stringarchive password
Returns
TypeValue
$this
$this.setLastModified(string $name, ?int $timestamp): this
Parameters
NameTypeValueDefault
namestring""
timestamp?intnow
Returns
TypeValue
$this
$this.setPassword(string $password): this
Parameters
NameTypeValueDefault
passwordstring""
Returns
TypeValue
$this
$this.write(string $name, string $string): this
Parameters
NameTypeValueDefault
namestring""
stringstring""
Returns
TypeValue
$this