PHPackages                             jakubboucek/tar-stream-reader - 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. jakubboucek/tar-stream-reader

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

jakubboucek/tar-stream-reader
=============================

Reader for TAR and TAR+GZip Archives, optimized for read huge size archives, effective memory usage.

v2.0.2(1y ago)51.8k2[2 PRs](https://github.com/jakubboucek/php-tar-stream-reader/pulls)MITPHPPHP ~8.0CI failing

Since Oct 12Pushed 1y ago1 watchersCompare

[ Source](https://github.com/jakubboucek/php-tar-stream-reader)[ Packagist](https://packagist.org/packages/jakubboucek/tar-stream-reader)[ RSS](/packages/jakubboucek-tar-stream-reader/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (2)Dependencies (3)Versions (8)Used By (0)

TAR Archive stream-based reader
===============================

[](#tar-archive-stream-based-reader)

Reader for TAR and TAR+GZip Archives, optimized for read huge size archives, effective memory usage.

Features
--------

[](#features)

- Read **TAR archives** from disk
- Support **GZipped** and **BZipped** archives
- Iterate over Archive content
- Get **name**, **size** and **type** of each file
- Recognize Directory files type
- Recognize Regular files type
- Get **content** of files
- Allows to export content to files
- Optimized for performance and low-memory
- Use stream-first access - file content not stored to memory

Install
-------

[](#install)

```
composer require jakubboucek/tar-stream-reader
```

Usage
-----

[](#usage)

Read files from an archive:

```
use JakubBoucek\Tar;

foreach (new Tar\FileReader('example.tar') as $file) {
    echo "File {$file->getName()} is {$file->getSize()} bytes size, content of file:\n";
    echo $fileInfo->getContent() . "\n";
}
```

Package recognizes few types of Archive when using classic filename extension (e.g.: `.tar`, `.tgz`, `.tar.bz2`), but You can explicitly define archive type thought second parameter:

```
use JakubBoucek\Tar;

foreach (new Tar\FileReader('example.tar+gzip', new Tar\Filehandler\Gzip()) as $file) {
    echo "File {$file->getName()} is {$file->getSize()} bytes size.\n";
}
```

Package allows to process any type of stream, use `StreamReader` instead of `FileReader`:

```
use JakubBoucek\Tar;

$stream = someBeatifulFuntionToGetStream();

foreach (new Tar\StreamReader($stream) as $file) {
    echo "File {$file->getName()} is {$file->getSize()} bytes size.\n";
}
```

FAQ
---

[](#faq)

### Can I use Package for ZIP, RAR, … archives?

[](#can-i-use-package-for-zip-rar--archives)

No, Package recognize only TAR Archive format, additionaly recognize GZipped or BZipped Archive.

### Can I use Package to create/modify Archive?

[](#can-i-use-package-to-createmodify-archive)

No, Package provide only read possibility.

### Can I search file in Archive?

[](#can-i-search-file-in-archive)

No, TAR Archive is stream-based format, it does not support search, you must always iterate over whole Archive.

### How big file I can proceed?

[](#how-big-file-i-can-proceed)

Here are two scopes of this question: **Archive size** or **Size of files in Archive**

- **Archive size** is teoretically unlimited, beacuse package is using stream very effective.
- **Size of files in Archive** is teoretically unlimited when use steam-based method to extraxt content (`toFile()` or `toStream()`), otherwise is size limited with available memory, because is content filled into variable.

Contributing
------------

[](#contributing)

Please don't hesitate send Issue or Pull Request.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity64

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~293 days

Recently: every ~366 days

Total

6

Last Release

614d ago

Major Versions

v0.1.2 → v2.0.02023-06-18

PHP version history (4 changes)v0.1.0PHP &gt;=7.3

v2.0.0PHP ~8.0.0 || ~8.1.0 || ~8.2.0

v2.0.1PHP ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0

v2.0.2PHP ~8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1657322?v=4)[Jakub Bouček](/maintainers/jakubboucek)[@jakubboucek](https://github.com/jakubboucek)

---

Top Contributors

[![jakubboucek](https://avatars.githubusercontent.com/u/1657322?v=4)](https://github.com/jakubboucek "jakubboucek (40 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/jakubboucek-tar-stream-reader/health.svg)

```
[![Health](https://phpackages.com/badges/jakubboucek-tar-stream-reader/health.svg)](https://phpackages.com/packages/jakubboucek-tar-stream-reader)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.2k532.1M2.5k](/packages/aws-aws-sdk-php)[symfony/symfony

The Symfony PHP framework

31.4k86.9M2.2k](/packages/symfony-symfony)[google/cloud

Google Cloud Client Library

1.2k16.5M57](/packages/google-cloud)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k496.1k33](/packages/neuron-core-neuron-ai)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[stechstudio/laravel-zipstream

A fast and simple streaming zip file downloader for Laravel.

4644.1M3](/packages/stechstudio-laravel-zipstream)

PHPackages © 2026

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