PHPackages                             clearlyphp/targz - 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. clearlyphp/targz

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

clearlyphp/targz
================

Simple tool to create tar.gz files without using PharData

v1.0.0(4y ago)08AGPL-3.0-onlyPHP

Since Jan 20Pushed 4y ago1 watchersCompare

[ Source](https://github.com/ClearlyPHP/TarGZ)[ Packagist](https://packagist.org/packages/clearlyphp/targz)[ RSS](/packages/clearlyphp-targz/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Clearly PHP TarGZ Creation tool
===============================

[](#clearly-php-targz-creation-tool)

After discovering that PharData has a [known memory leak](https://bugs.php.net/bug.php?id=81017), and is not recommended to be used *at all*, we needed a standard way of creating TarGz's that will be simple and portable.

This uses the fantastic code from [splitbrain/php-archive](https://github.com/splitbrain/php-archive) and is simply a wrapper around it.

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

[](#installation)

```
composer require clearlyphp/targz

```

Usage
-----

[](#usage)

The API is extremely simple, and there is 100% test code coverage so you can read them for detailed examples

```
use ClearlyPHP\Tools\TarGz;
$output = "/tmp/output.tar.gz";
$t = new TarGz($output);
$t->addSrcDir("/var/log");
$t->create();

```

You can configure if the directory name is included, and if it recurses into subfolders with the second and third params:

```
TarGz::addSrcDir(string $srcdir, bool $includedirname = true, bool $recurse = true)

```

Extending
---------

[](#extending)

If you want to extend this class, (ie, to add filters) simply modify `TarGz::$files` before calling create()

About Clearly PHP
=================

[](#about-clearly-php)

Clearly PHP is a collection of useful tools that [ClearlyIP](https://clearlyip.com) use, and publish to the world.

ClearlyIP consists of most of the previous FreePBX developers, and we are one of the leaders in Open Source telephony, along with being active members of the Open Source community! If you're looking for anything from custom VoIP development, to wholesale high-volume SIP trunking, we can help you out.

If you're interested in more of our open source code, here's some links to our personal github pages

- [Andrew (tm1000)](https://github.com/tm1000)
- [Bryan (GameGamer43)](https://github.com/GameGamer43)
- [Francois-Alexandre (Fasa)](https://github.com/f-asa)
- [Julien](https://github.com/julienchabanon)
- [Mamadou](https://github.com/madkonix)
- [Rob (xrobau)](https://github.com/xrobau)
- [Stas](https://github.com/staskobzar)

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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

1625d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/457798?v=4)[Rob Thomas](/maintainers/xrobau)[@xrobau](https://github.com/xrobau)

---

Top Contributors

[![xrobau](https://avatars.githubusercontent.com/u/457798?v=4)](https://github.com/xrobau "xrobau (5 commits)")

---

Tags

packagetar.gzphardata

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/clearlyphp-targz/health.svg)

```
[![Health](https://phpackages.com/badges/clearlyphp-targz/health.svg)](https://phpackages.com/packages/clearlyphp-targz)
```

###  Alternatives

[composer/composer

Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.

29.5k196.2M3.1k](/packages/composer-composer)[jean85/pretty-package-versions

A library to get pretty versions strings of installed dependencies

1.3k315.9M84](/packages/jean85-pretty-package-versions)[composer/satis

Simple Repository Generator

3.3k1.4M19](/packages/composer-satis)[fxp/composer-asset-plugin

NPM/Bower Dependency Manager for Composer

9434.8M41](/packages/fxp-composer-asset-plugin)[nunomaduro/essentials

Just better defaults for your Laravel projects.

1.2k563.0k104](/packages/nunomaduro-essentials)[christiankuri/laravel-favorite

Allows Laravel Eloquent models to implement a 'favorite' or 'remember' or 'follow' feature.

227484.2k6](/packages/christiankuri-laravel-favorite)

PHPackages © 2026

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