(PHP 5 >= 5.2.0, PHP 7, PHP 8, PECL zip >= 1.1.0)
Introduction
Un fichier d'archive, compressé avec Zip.
Synopsis de la classe
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 getCommentName
(
string $name
,
int $flags
= 0
) :
string|false
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 locateName
(
string $name
,
int $flags
= 0
) :
int|false
public open
(
string $filename
,
int $flags
= 0
) :
bool|int
public renameIndex
(
int $index
,
string $new_name
) :
bool
public renameName
(
string $name
,
string $new_name
) :
bool
public replaceFile
(
string $filepath
,
string $index
,
int $start
= 0
,
int $length
= 0
,
int $flags
= 0
) :
bool
public setEncryptionIndex
(
int $index
,
int $method
,
string|null $password
= null
) :
bool
public setEncryptionName
(
string $name
,
int $method
,
string|null $password
= null
) :
bool
public setMtimeIndex
(
int $index
,
int $timestamp
,
int $flags
= 0
) :
bool|null
public setMtimeName
(
string $name
,
int $timestamp
,
int $flags
= 0
) :
bool|null
public statIndex
(
int $index
,
int $flags
= 0
) :
array|false
public statName
(
string $name
,
int $flags
= 0
) :
array|false
}
Propriétés
- lastId
-
Valeur de l'index de la dernière entrée (fichier ou dossier)
Disponible à partir de PHP 8.0.0 et PECL zip 1.18.0.
- status
-
Le statut de l'archive Zip.
Disponible pour les archives fermées, à partir de PHP 8.0.0 et PECL zip 1.18.0.
- statusSys
-
Le statut système de l'archive Zip.
Disponible pour les archives fermées, à partir de PHP 8.0.0 et PECL zip 1.18.0.
- numFiles
-
Le nombre de fichiers dans l'archive
- filename
-
Le nom du fichier dans le système de fichiers
-
Commentaire pour l'archive