Zip
class Zip implements ArchiverInterface (View source)
Defines a archiver implementation for .zip files.
Properties
| protected ZipArchive | $zip | The underlying ZipArchive instance that does the heavy lifting. |
Methods
Constructs a Zip object.
Adds the specified file or directory to the archive.
Removes the specified file from the archive.
Extracts multiple files in the archive to the specified path.
Lists all files in the archive.
Retrieves the zip engine itself.
Details
__construct(string $file_path)
Constructs a Zip object.
$this
add(string $file_path)
Adds the specified file or directory to the archive.
$this
remove($file_path)
Removes the specified file from the archive.
$this
extract(string $path, array $files = [])
Extracts multiple files in the archive to the specified path.
array
listContents()
Lists all files in the archive.
ZipArchive
getArchive()
Retrieves the zip engine itself.
In some cases it may be necessary to directly access the underlying ZipArchive object for implementation-specific logic. This is for advanced use only as it is not shared by other implementations of ArchiveInterface.