Download the PHP package esplora/decompresso without Composer
On this page you can find all versions of the php package esplora/decompresso. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download esplora/decompresso
More information about esplora/decompresso
Files in esplora/decompresso
Package decompresso
Short Description PHP library for unlock contents from various files with ease.
License MIT
Informations about the package decompresso
Lumos
Lumos is a universal library designed to provide a unified interface for processing various file types. Whether you need to unlock passwords from office documents or extract contents from compressed archives, Lumos simplifies these tasks with ease and efficiency.
Features
- Unlock Password-Protected Files: Remove passwords from encrypted office documents (PDF, DOC, etc.) effortlessly.
- Extract Archives: Unpack various archive formats (ZIP, RAR, etc.), including those secured with passwords.
- Flexible Handler System: Easily add and configure handlers for different file formats and operations.
- Intuitive Interface: Utilize a fluent API for convenient configuration and handling of successful or failed operations.
External Dependencies
Lumos relies on the following third-party tools for specific operations:
File Type | Tool | Description |
---|---|---|
qpdf | Handles processing and unlocking of PDF files. | |
Office Formats | msoffcrypto-tool | Manages decryption of Microsoft Office files. |
Zip Archive | Built-in PHP classes | Uses PHP's ZipArchive. |
Installation
Install the library using Composer:
Usage
To get started, create an instance of the FileProcessor
class and add the necessary handlers for file formats. The example below demonstrates using ZipArchiveAdapter
for ZIP files, but you can add your own handlers or use built-in ones.
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.
If needed, you can create your own password provider by implementing the PasswordProviderInterface
.
Event Handling
For more control over the file processing, you can add event handlers. This allows you to receive information about the reasons for failures or respond to successful completions.
TODO
- [x] Добавить файл ответа, который бы разделял "не смогли обработать" из-за ошибки и "не смогли обработать так как не подошёл пароль".
- [ ] Добавить обработчик для RAR-архивов.
- [ ] Добавить обработчик для 7z-архивов.
- [x] Добавить проверку целостности в тестах.
- [x] Ввести проверку на расширение файла для обработчика, чтобы он пропускал файлы неподдерживаемых форматов.
- [ ] Подумать над тем, чтобы передавать сразу MIME-type в обработчик, а не создавать его каждый раз. - Нет. Будет нарушение ответственности.
- [x] Не обращаться к провайдеру паролей, если он не нужен.
- [ ] Нужно обновить комментарии! Про пароль тоже!
License
The MIT License (MIT). Please see License File for more information.