PHPackages                             dezull/unarchiver - 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. dezull/unarchiver

ActiveLibrary

dezull/unarchiver
=================

Extract archives using libarchive tools and unrar

0495PHPCI passing

Since Jul 29Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/dezull/php-unarchiver)[ Packagist](https://packagist.org/packages/dezull/unarchiver)[ RSS](/packages/dezull-unarchiver/feed)WikiDiscussions main Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Unarchiver
==========

[](#unarchiver)

This PHP library, as the name implies, only supports archive listing and extraction.

Why?
----

[](#why)

I created this specifically for my need to list the content of very large archives. Instead of returning a large array, this library returns a `Generator` instead. This keeps the memory usage constantly low.

Since other libraries already offer archiving and other great features, I decided not to add them here.

Installation
------------

[](#installation)

1. Install dependencies (eg: Ubuntu):

```
sudo apt install libarchive-tools p7zip-full unrar
```

2. Install the package via Composer:

```
composer require dezull/unarchiver
```

Usage
-----

[](#usage)

Create an instance of the unarchiver:

```
use Dezull\Unarchiver\Unarchiver;

$ua = Unarchiver::open('/path/to/file.zip’);
```

If the archive is encrypted, pass the password as the second argument.

### Extraction

[](#extraction)

```
$ua->extract('/path/to/output-dir');
```

### Listing Content

[](#listing-content)

```
foreach ($ua->getEntries() as $entry) {
    // @var Dezull\Unarchiver\Entry\EntryInterface
    echo $entry->getPath().PHP_EOL;
}
```

API
---

[](#api)

### Unarchiver

[](#unarchiver-1)

MethodReturnUsage`getEntries()``Generator``getEntry($filename)``?EntryInterface``extract(string $outputDirectory, ?array $filenames = null, bool $overwrite = true)``string[]` (filenames)`setTimeout(int $seconds)``Unarchiver`Kill the unarchiver process after this timeout### EntryInterface

[](#entryinterface)

MethodReturnUsage`isDirectory()``bool``getPath()``string``getSize()``?int``getPackedSize()``?int``getModificationTime()``?DateTime``getCrc()``?string``extract(string $outputDirectory, bool $overwrite = true)``void`Supported Archive Formats
-------------------------

[](#supported-archive-formats)

Currently, this library relies on `bsdtar`, `7z`, and `unrar` binaries. It supports formats handled by these binaries.

Caveats
-------

[](#caveats)

The `EntryInterface#getEntry()` and `EntryInterface#extract()` methods use the underlying binary to pass on the specific filename. The binary may treat the **filename as a pattern**.

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance43

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/633238590fce2a081f23448c6ebbcc707b3f4758875e3561439d958f0c9802b4?d=identicon)[dezull](/maintainers/dezull)

---

Top Contributors

[![dezull](https://avatars.githubusercontent.com/u/318483?v=4)](https://github.com/dezull "dezull (24 commits)")

### Embed Badge

![Health badge](/badges/dezull-unarchiver/health.svg)

```
[![Health](https://phpackages.com/badges/dezull-unarchiver/health.svg)](https://phpackages.com/packages/dezull-unarchiver)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
