selective / rar
RAR file reader
Installs: 6 425
Dependents: 1
Suggesters: 1
Security: 0
Stars: 19
Watchers: 3
Forks: 5
Open Issues: 0
Requires
- php: ^8.1
Requires (Dev)
This package is auto-updated.
Last update: 2024-10-09 23:47:00 UTC
README
RAR file reader for PHP.
Features
- Read RAR file information
- RAR 5 archive format
- RAR 4 archive format
- No dependencies
- Very fast
Note: This package does not support extracting / unpacking rar archives.
Requirements
- PHP 8.1+
The PECL RAR package is NOT required
Installation
composer require selective/rar
Usage
Open RAR file
use Selective\Rar\RarFileReader; use SplFileObject; $rarFileReader = new RarFileReader(); $rarArchive = $rarFileReader->openFile(new SplFileObject('test.rar')); foreach ($rarArchive->getEntries() as $entry) { echo $entry->getName() . "\n"; }
Open in-memory RAR file
use Selective\Rar\RarFileReader; use SplTempFileObject; $file = new SplTempFileObject(); $file->fwrite('my binary rar content'); $rarFileReader = new RarFileReader(); $rarArchive = $rarFileReader->openFile($file); foreach ($rarArchive->getEntries() as $entry) { echo $entry->getName() . "\n"; }
License
The MIT License (MIT). Please see License File for more information.