bitandblack/unzip
Unpacks ZIP content on the fly, without writing to the file system. Handles files, strings and ressources.
Maintainers
Requires
- php: >=7.4
- ext-zip: *
- nelexa/zip: ^4.0
- symfony/polyfill-php80: ^1.22
Requires (Dev)
- bitandblack/helpers: ^1.6
- maennchen/zipstream-php: ^2.1
- phpstan/phpstan: ^0.12
- phpunit/phpunit: ^9.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
MIT 7738f224ef8c882bb53c610e613c3ccee49fa4de
- Tobias LKöngeter <hello.woop@bitandblack.com>
This package is auto-updated.
Last update: 2026-06-23 22:00:54 UTC
README
👁 PHP from Packagist
👁 Latest Stable Version
👁 Total Downloads
👁 License
Bit&Black Unzip
Unpacks ZIP content on the fly, without writing to the file system. Handles files, strings and ressources.
Installation
This library is made for the use with Composer. Add it to your project by running $ composer require bitandblack/unzip.
Usage
Using the auto ZIP handler
Maybe the easiest way is to use the AutoZIPHandler. It detects the kind of ZIP content by its own and returns a FileType, StringType or StreamType object.
<?php
use BitAndBlack\Unzip\AutoZIPHandler;
$zipContent = AutoZIPHandler::create($whateverZIPContent);
Call getContents() to see what is inside the ZIP.
The ZIP content can be extracted to the file system by calling extractTo().
Manual set up
You can set up the file type by your own too. For example:
<?php
use BitAndBlack\Unzip\Type\FileType;
$fileType = new FileType('/path/to/file.zip');
$contents = $fileType->getContents();
Help
If you have questions feel free to contact us under hello@bitandblack.com.
