Download the PHP package originphp/zip without Composer
On this page you can find all versions of the php package originphp/zip. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download originphp/zip
More information about originphp/zip
Files in originphp/zip
Package zip
Short Description OriginPHP Zip
License MIT
Homepage https://www.originphp.com
Informations about the package zip
Zip
A ZIP utility for creating and unziping ZIP files.
Installation
To install this package
Static Methods
The static methods provide a quick way to zip and unzip archives.
Create a ZIP Archive
To create a ZIP archive using a file or directory
You can also ZIP multiple files or directories
You can also pass any of the following options keys
- password: a password used to encrypt the archive with
- compress: default:
true
. Set tofalse
to only store the files (without compression) - encryption: default:
aes256
. This is the encryption method used when using a password. Supported encryption methods:aes128
,aes192
,andaes256
.
To encrypt files with passwords you need to be using PHP 7.3 or above.
Unzip a ZIP Archive
To unzip a ZIP file
If any of the files are encrypted you provide a password like this
Fluent Interface
The ZIP class also provides a fluent interface for working with ZIP archives.
Create a ZIP Archive
To create a new ZIP and files and directories. When you add a directory it will add all files and sub directories recursively.
Encryption
To encrypt files with passwords you need to be using PHP 7.3 or above.
To encrypt all the files in the archive, call the encrypt
method after adding the files, you can optionally supply the encryption method. Supported encryption methods are aes128
,aes192
and aes256
.
If just want to encrypt certain files
Compression
If you just want to store a file in the ZIP archive without compression you can set compress
to false
.
Unzip a ZIP Archive
To extract files from a ZIP file
If the ZIP file has encrypted files
You can also extract selected files
Listing contents
To list contents of a ZIP file
This will output like this
You can also just list files from within a folder of the ZIP file
Getting contents of a file
To get the contents of a file
Renaming
To rename a file in a ZIP archive
Deleting Files
To delete a file from a ZIP archive
All versions of zip with dependencies
ext-zip Version *