PHPackages                             biohzrdmx/tar-reader-php - 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. biohzrdmx/tar-reader-php

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

biohzrdmx/tar-reader-php
========================

Tar file reading library

1.0(3y ago)01MITPHPPHP &gt;=8.1

Since Nov 15Pushed 3y ago1 watchersCompare

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

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

tar-reader-php
==============

[](#tar-reader-php)

Tar file reading library.

With TarReader you can browse the contents of a tarball, not just extract it.

### Basic usage

[](#basic-usage)

First require `biohzrdmx/tar-reader-php` with Composer.

Then just create a `TarReader` instance passing an archive path:

```
use TarReader\TarReader;

$tar = new TarReader( __DIR__ . DIRECTORY_SEPARATOR . 'file.tar.gz' );
```

The library supports `tar`, `tar.gz` and `tar.bz2` archives.

To get the contents of the archive call the `getEntries` method:

```
$entries = $tar->getEntries();
```

This function returns an array of objects, each with the following properties:

- `checksum` - Checksum of the entry, example: `5989`
- `filename` - File name, example: `"lorem.txt"`
- `perm` - Permission mask, example: `511`
- `uid` - Numeric user ID of the file owner, example: `1000`
- `gid` - Numeric group ID of the file owner, example: `1000`
- `size` - Size, in bytes, example: `19`
- `mtime` - Last modified timestamp, example: `1668473650`
- `typeflag` - Type of entry, example: `"0"`
- `link` - Link name, if applicable, example: `""`
- `uname` - User name of the file owner, example: `"www-data"`
- `gname` - Group name of the file owner, example: `"www-data"`
- `offset` - Entry offset, example: `2560`

You can also get the contents of an specific entry with the `readEntry` method:

```
$entry = $entries[1] ?? null;
if ($entry) {
  $data = $tar->readEntry($entry);
  file_put_contents(__DIR__ . DIRECTORY_SEPARATOR . $entry->filename, $data);
}
```

### Licensing

[](#licensing)

This software is released under the MIT license.

Copyright © 2022 biohzrdmx.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

### Credits

[](#credits)

**Lead coder:** biohzrdmx [github.com/biohzrdmx](http://github.com/biohzrdmx)

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

1279d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/44b968bb45d47a621ce8e81c422ef4c126316a702156a7faf96df75610cc0d45?d=identicon)[biohzrdmx](/maintainers/biohzrdmx)

---

Top Contributors

[![biohzrdmx](https://avatars.githubusercontent.com/u/2053303?v=4)](https://github.com/biohzrdmx "biohzrdmx (3 commits)")

---

Tags

composer-libraryphptar

### Embed Badge

![Health badge](/badges/biohzrdmx-tar-reader-php/health.svg)

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

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[google/cloud-storage

Cloud Storage Client for PHP

34390.8M125](/packages/google-cloud-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15261.6M2.6k](/packages/illuminate-filesystem)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)

PHPackages © 2026

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