PHPackages                             mishak/archive-tar - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. mishak/archive-tar

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mishak/archive-tar
==================

Archive TAR reader for PHP - supports gz, bz2 and files over 2 GB

v1.1.0(10y ago)121744[1 issues](https://github.com/mishak87/archive-tar/issues)BSD-3-ClausePHPPHP &gt;=5.3.0

Since Sep 27Pushed 10y ago2 watchersCompare

[ Source](https://github.com/mishak87/archive-tar)[ Packagist](https://packagist.org/packages/mishak/archive-tar)[ RSS](/packages/mishak-archive-tar/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (5)Used By (0)

Archive TAR Reader for PHP
==========================

[](#archive-tar-reader-for-php)

Simple tool for reading TAR archives in PHP. Supports records with size larger then PHP\_INT\_MAX (slightly less then 2 GB).

**Supports only USTAR format.** This should be the most used TAR format after 1988.

Gz and bz2 compressions are transparently supported via detection from filename extension.

Installation
------------

[](#installation)

Add to your `composer.json` requirement `"mishak/archive-tar": "dev-master"`.

Examples
--------

[](#examples)

### List all records in archive

[](#list-all-records-in-archive)

```
$filename = 'archive.tar';
$reader = new Mishak\ArchiveTar\Reader($filename);
$read->setBuffer(PHP_INT_MAX);
$read->setReadContents(FALSE);
foreach ($reader as $record) {
	print_r($record);
}
```

### Print all file records with contents

[](#print-all-file-records-with-contents)

```
$filename = 'archive.tar';
$reader = new Mishak\ArchiveTar\Reader($filename);
foreach ($reader as $record) {
	if (in_array($record['type'], array(\Mishak\ArchiveTar\Reader::REGULAR, \Mishak\ArchiveTar\Reader::AREGULAR), TRUE)) {
		echo $record['filename'], "\n";
		echo $record['contents'], "\n";
	}
}
```

### Print all file records via function callback

[](#print-all-file-records-via-function-callback)

This will produce exactly same output as previous example.

```
$filename = 'archive.tar';
$reader = new Mishak\ArchiveTar\Reader($filename);
$lastRecord = NULL;
$read->setReadContents(function ($record, $chunk, $left, $read) use ($lastRecord) {
	if (!in_array($record['type'], array(\Mishak\ArchiveTar\Reader::REGULAR, \Mishak\ArchiveTar\Reader::AREGULAR), TRUE)) {
		continue;
	}
	if (NULL === $lastRecord || $record['filename'] !== $lastRecord['filename']) {
		if (NULL !== $lastRecord) {
			echo "\n";
		}
		echo $record['filename'], "\n";
	}
	echo $chunk;
	if (!$left) {
		echo "\n";
	}
}
});
foreach ($reader as $record) {
	// don't mind just walking thru...
}
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 86.7% 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 ~917 days

Total

2

Last Release

3699d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/276500?v=4)[Michal Gebauer](/maintainers/mishak87)[@mishak87](https://github.com/mishak87)

---

Top Contributors

[![mishak87](https://avatars.githubusercontent.com/u/276500?v=4)](https://github.com/mishak87 "mishak87 (13 commits)")[![enumag](https://avatars.githubusercontent.com/u/539462?v=4)](https://github.com/enumag "enumag (1 commits)")[![timgws](https://avatars.githubusercontent.com/u/1050232?v=4)](https://github.com/timgws "timgws (1 commits)")

---

Tags

archivetarreader

### Embed Badge

![Health badge](/badges/mishak-archive-tar/health.svg)

```
[![Health](https://phpackages.com/badges/mishak-archive-tar/health.svg)](https://phpackages.com/packages/mishak-archive-tar)
```

###  Alternatives

[alchemy/zippy

Zippy, the archive manager companion

47522.6M51](/packages/alchemy-zippy)[gemorroj/archive7z

7z cli wrapper

103963.0k1](/packages/gemorroj-archive7z)[wapmorgan/binary-stream

A handy tool for working with binary data

52263.1k6](/packages/wapmorgan-binary-stream)[selective/array-reader

A strictly typed array reader

1168.7k5](/packages/selective-array-reader)[dmitrirussu/rjson-php

Compress array collection data to json

143.8k](/packages/dmitrirussu-rjson-php)[entrepreneur-interet-general/bulletins

Bulletins is a simple weekly retrospective tool for multiple projects or teams

122.6k](/packages/entrepreneur-interet-general-bulletins)

PHPackages © 2026

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