(PHP 5 >= 5.2.0, PHP 7, PHP 8, PECL zip >= 1.1.0)
はじめに
Zip で圧縮されたファイルアーカイブです。
クラス概要
public addEmptyDir(
string $dirname,
int $flags = 0):
bool
public addFile(
string $filepath,
string $entryname = "",
int $start = 0,
int $length = 0,
int $flags = ZipArchive::FL_OVERWRITE):
bool
public addFromString(
string $name,
string $content,
int $flags = ZipArchive::FL_OVERWRITE):
bool
public addGlob(
string $pattern,
int $flags = 0,
array $options = []):
array|false
public addPattern(
string $pattern,
string $path = ".",
array $options = []):
array|false
public extractTo(
string $pathto,
array|string|null $files = null):
bool
public getFromIndex(
int $index,
int $len = 0,
int $flags = 0):
string|false
public getFromName(
string $name,
int $len = 0,
int $flags = 0):
string|false
public getNameIndex(
int $index,
int $flags = 0):
string|false
public getStream(
string $name):
resource|false
public getStreamName(
string $name,
int $flags = 0):
resource|false
public locateName(
string $name,
int $flags = 0):
int|false
public open(
string $filename,
int $flags = 0):
bool|int
public renameName(
string $name,
string $new_name):
bool
public replaceFile(
string $filepath,
int $index,
int $start = 0,
int $length = 0,
int $flags = 0):
bool
public setMtimeIndex(
int $index,
int $timestamp,
int $flags = 0):
bool
public setMtimeName(
string $name,
int $timestamp,
int $flags = 0):
bool
public statIndex(
int $index,
int $flags = 0):
array|false
public statName(
string $name,
int $flags = 0):
array|false
}
プロパティ
- lastId
-
最後に追加されたエントリのインデックス(ファイルまたはディレクトリ)。
PHP 8.0.0 以降および PECL 1.18.0 以降で利用可能です。
- status
-
Zip アーカイブの状態。
PHP 8.0.0 以降および PECL 1.18.0 以降では、閉じられたアーカイブでも利用可能です。
- statusSys
-
Zip アーカイブのシステム状態。
PHP 8.0.0 以降および PECL 1.18.0 以降では、閉じられたアーカイブでも利用可能です。
- numFiles
-
アーカイブ内のファイル数
- filename
-
ファイルシステム上のファイル名
-
アーカイブのコメント