PHPackages                             esplora/decompresso - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. esplora/decompresso

ActiveLibrary[File &amp; Storage](/categories/file-storage)

esplora/decompresso
===================

PHP library for unlock contents from various files with ease.

1.1.0(1y ago)1262[1 issues](https://github.com/bunnivo/lumos/issues)[2 PRs](https://github.com/bunnivo/lumos/pulls)MITPHPPHP ^8.2CI passing

Since Aug 20Pushed 6mo ago2 watchersCompare

[ Source](https://github.com/bunnivo/lumos)[ Packagist](https://packagist.org/packages/esplora/decompresso)[ RSS](/packages/esplora-decompresso/feed)WikiDiscussions master Synced today

READMEChangelog (9)Dependencies (7)Versions (15)Used By (0)

[![Lumos](.github/logo.svg?sanitize=true)](.github/logo.svg?sanitize=true) Lumos
================================================================================

[](#-lumos)

[![Tests](https://github.com/esplora/decompresso/actions/workflows/phpunit.yml/badge.svg)](https://github.com/esplora/decompresso/actions/workflows/phpunit.yml)[![Quality Assurance](https://github.com/esplora/lumos/actions/workflows/quality.yml/badge.svg)](https://github.com/esplora/lumos/actions/workflows/quality.yml)[![Coding Guidelines](https://github.com/esplora/lumos/actions/workflows/php-cs-fixer.yml/badge.svg)](https://github.com/esplora/lumos/actions/workflows/php-cs-fixer.yml)

Lumos is a library that provides a interface for removing passwords from protected documents and archives (extracting content), making these tasks simple and accessible.

###### What can I use this for?

[](#what-can-i-use-this-for)

- Integrating with DLP platforms for protected file processing, ensuring compliance with corporate policies.
- Unlock password-protected documents and archives for data extraction using tools like [Apache Tika](https://tika.apache.org/).
- Utilize online services for removing passwords or recovering them through methods like brute force.

External Dependencies
---------------------

[](#external-dependencies)

Lumos uses the following third-party tools for operations. Each adapter is provided out of the box in the `Esplora\Lumos\Adapters\*` namespace:

**File Type****Tool****Adapter Class**PDF[qpdf](https://github.com/qpdf/qpdf)QpdfAdapterMicrosoft Office[msoffcrypto-tool](https://github.com/nolze/msoffcrypto-tool)MSOfficeCryptoToolAdapterArchive (ZIP, 7z)[7-zip](https://www.7-zip.org/)SevenZipAdapterGnuPG (.gpg)[gpg](https://gnupg.org/)GpgAdapterEmail Message Format (.eml)[cosmira/envelope](https://github.com/cosmira/envelope)EnvelopeAdapterInstallation
------------

[](#installation)

Install the library using Composer:

```
composer require esplora/lumos
```

Basic Usage
-----------

[](#basic-usage)

To get started, create an instance of the `Extractor` class and add the necessary adapters for file formats. The example below demonstrates using `SevenZipAdapter` for archive, but you can add your own adapters:

```
use Esplora\Lumos\Extractor;
use Esplora\Lumos\Adapters\SevenZipAdapter;

$lumos = Extractor::make([
    new SevenZipAdapter(),
])
    ->extract('/path/to/your/archive.zip');

$lumos->isSuccessful(); // true
$lumos->attempts(); // 1
```

Note

When multiple adapters are suitable for a given file, the first adapter in the list will be selected.

Handling Password-Protected Files
---------------------------------

[](#handling-password-protected-files)

To work with password-protected documents, add a password provider. The example below uses `ArrayPasswordProvider`, which accepts an array of passwords.

```
use Esplora\Lumos\Extractor;
use Esplora\Lumos\Adapters\QpdfAdapter;
use Esplora\Lumos\Adapters\SevenZipAdapter;
use Esplora\Lumos\Adapters\MSOfficeCryptoToolAdapter;
use Esplora\Lumos\Providers\ArrayPasswordProvider;

$passwords = new ArrayPasswordProvider([
    'qwerty',
    'xxx123',
]);

Extractor::make()
    ->withAdapters([
        new QpdfAdapter(),
        new SevenZipAdapter(),
        new MSOfficeCryptoToolAdapter(),
    ])
    ->withPasswords($passwords)
    ->extract('/path/to/your/archive.zip', '/path/to/save/to')
    ->isSuccessful(); // false
```

If needed, you can create your own password provider by implementing the `PasswordProviderInterface`.

Tip

If you don’t have a password database but want to try all possible combinations, you can use [SecLists](https://github.com/danielmiessler/SecLists/tree/master/Passwords) as a source of popular passwords for brute-forcing.

Creating Custom Adapters
------------------------

[](#creating-custom-adapters)

Lumos allows you to easily add support for new file types by creating custom adapters. To do so, implement a class that conforms to the `Esplora\Lumos\Contracts\AdapterInterface`.

Example of a custom adapter implementation:

```
namespace Esplora\Lumos\Adapters;

use Esplora\Lumos\Contracts\AdapterInterface;
use Esplora\Lumos\Contracts\PasswordProviderInterface;
use Esplora\Lumos\Results\SummaryInterface;

class CustomAdapter implements AdapterInterface
{
    /**
     * Checks if the adapter supports the given file.
     */
    public function canSupport(string $filePath): bool
    {
        return str_ends_with($filePath, '.custom');
    }

    /**
     * Checks if the environment is properly configured.
     */
    public function isSupportedEnvironment(): bool
    {
        return true; // Check external dependencies here
    }

    /**
     * Extracts the content to the specified directory.
     */
    public function extract(string $filePath, string $destination, PasswordProviderInterface $passwords): SummaryInterface
    {
        // Implement extraction logic here
    }
}
```

The library provides common tools to check if a specific file is supported using built-in traits:

To check based on the file's MIME type, use the trait `SupportsMimeTypes`:

```
use Esplora\Lumos\Concerns\SupportsMimeTypes;

class CustomAdapter implements AdapterInterface
{
    use SupportsMimeTypes;

    /**
     * Returns a list of supported MIME types.
     *
     * @return array An array of supported MIME types.
     */
    protected function supportedMimeTypes(): array
    {
        return [
            'application/pdf', // Support for PDF files
            'image/jpeg',      // Support for JPEG images
        ];
    }

    // ...
}
```

To check based on file extensions, use the trait `SupportsFileExtensions`:

```
use Esplora\Lumos\Concerns\SupportsFileExtensions;

class CustomAdapter implements AdapterInterface
{
    use SupportsFileExtensions;

    /**
     * Returns a list of allowed file extensions.
     *
     * @return array An array of allowed extensions.
     */
    protected function allowedExtensions(): array
    {
        return [
            'txt',  // Support for text files
            'zip',  // Support for ZIP archives
        ];
    }

    // ...
}
```

Testing
-------

[](#testing)

Testing an application that depends on other services can be challenging, but this should not prevent you from contributing to the project.

For adapters that depend on executable files, you can pass the path via the constructor:

```
use Esplora\Lumos\Adapters\SevenZipAdapter;

new SevenZipAdapter('/usr/bin/7z'),
```

For convenience, we also support using environment variables from a `.env` file to store paths to dependency executables in one place. To do this, create a `.env` file at the root of your project and add the environment variables as shown in the `.env.example`.

Warning

Environment variables from the `.env` file will be loaded only for local testing and are added solely for the convenience of developing this package.

Troubleshooting
---------------

[](#troubleshooting)

### Password Issues

[](#password-issues)

Sometimes, the issue may be due to different encoding types, such as `WINDOWS-CP1251` for Eastern Europe, while the software might input it as `UTF-8`. So, even if the password looks identical, it’s important to use the correct encoding.

### Corrupted or Multipart Archive

[](#corrupted-or-multipart-archive)

The library doesn’t currently handle corruption detection or combining multipart archives. If the file is incompatible, the message will indicate that the password is incorrect.

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance59

Moderate activity, may be stable

Popularity15

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 99.1% 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.

###  Release Activity

Cadence

Every ~39 days

Recently: every ~49 days

Total

9

Last Release

368d ago

Major Versions

0.2.0 → 1.0.02025-03-04

### Community

Maintainers

![](https://www.gravatar.com/avatar/3c47797b11041f37c2eec74b09bc6619c8997467d690797ebad0e6ab7cb232b7?d=identicon)[tabuna](/maintainers/tabuna)

---

Top Contributors

[![tabuna](https://avatars.githubusercontent.com/u/5102591?v=4)](https://github.com/tabuna "tabuna (232 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")

---

Tags

archivesextractingdecompression

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/esplora-decompresso/health.svg)

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

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M20.0k](/packages/laravel-framework)[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.2k95.4M303](/packages/laravel-horizon)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

21866.0M1.7k](/packages/drupal-core)[illuminate/console

The Illuminate Console package.

13046.0M6.5k](/packages/illuminate-console)[illuminate/http

The Illuminate Http package.

11937.9M6.9k](/packages/illuminate-http)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6942.5M419](/packages/drupal-core-recommended)

PHPackages © 2026

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