Simple tool to create tar.gz files without using PharData

Maintainers

👁 xrobau

Package info

github.com/ClearlyPHP/TarGZ

pkg:composer/clearlyphp/targz

Statistics

Installs: 8

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2022-01-20 02:22 UTC

Requires

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

AGPL-3.0-only 5a7a4dfe0c85d4aadad5373a3332718174e494df

  • Rob Thomas <xrobau.woop@gmail.com>

packagetargzphardata

This package is auto-updated.

Last update: 2026-06-21 06:54:49 UTC


README

After discovering that PharData has a known memory leak, 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 and is simply a wrapper around it.

Installation

composer require clearlyphp/targz

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

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

About Clearly PHP

Clearly PHP is a collection of useful tools that ClearlyIP 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