PHPackages                             codebites/cli-7zip - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. codebites/cli-7zip

ActiveLibrary[CLI &amp; Console](/categories/cli)

codebites/cli-7zip
==================

A wrapper for 7-zip CLI to compress, decompress and manipulate archives.

v0.1.3(1y ago)0473↓100%MITPHPPHP &gt;=8.2

Since Jul 8Pushed 1y agoCompare

[ Source](https://github.com/codebites-cgn/cli7zip)[ Packagist](https://packagist.org/packages/codebites/cli-7zip)[ Docs](https://github.com/codebites-cgn/cli7zip)[ RSS](/packages/codebites-cli-7zip/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (5)Used By (0)

Cli7zip - PHP Wrapper for 7zip
==============================

[](#cli7zip---php-wrapper-for-7zip)

Description
-----------

[](#description)

This is a simple wrapper around the CLI binary of [7-zip](https://www.7-zip.org/). I tried to abstract the most commonly used commands like **verify**, **extract**, **create** and **add**. It will try to find the `7zz` binary automatically on your system. I chose to use `7zz` because it's statically linked and standalone thus perfect for shipping without any dependencies. You are also free to use other compatible binaries like `7zr` or `7za` by passing it to the constructor. If it can't find `7zz` on your system, it will default to the bundled binary from the `./bin` folder. I only bundle the `Linux x86_64` for now. You also have the possibility to point to additional paths in which the library should look for the binary via the constructor of the `Cli7zip` class.

Because we use the full version we have support for all archive formats, not only `.7z`. Taken from the website of 7-zip it should support the following formats:

- Packing / unpacking: 7z, XZ, BZIP2, GZIP, TAR, ZIP and WIM
- Unpacking only: APFS, AR, ARJ, CAB, CHM, CPIO, CramFS, DMG, EXT, FAT, GPT, HFS, IHEX, ISO, LZH, LZMA, MBR, MSI, NSIS, NTFS, QCOW2, RAR, RPM, SquashFS, UDF, UEFI, VDI, VHD, VHDX, VMDK, XAR and Z

Prerequisites
-------------

[](#prerequisites)

- PHP &gt;= 8.2

Install
-------

[](#install)

- `composer require codebites/cli-7zip`

Usage
-----

[](#usage)

```
