PHPackages                             tbcd/file-archiver - 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. tbcd/file-archiver

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

tbcd/file-archiver
==================

A library to manage files archiving as well as their rotation

1.3.0(3y ago)071MITPHPPHP &gt;=8.1

Since May 3Pushed 3y ago1 watchersCompare

[ Source](https://github.com/ThomasBeauchataud/FileArchiver)[ Packagist](https://packagist.org/packages/tbcd/file-archiver)[ RSS](/packages/tbcd-file-archiver/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

FileArchiver
============

[](#filearchiver)

FileArchiver is a library to manage files archiving as well as their rotation and their recovery

Table of content
----------------

[](#table-of-content)

- [Archivage](#archivage)
- [Suppression and rotation](#suppression-and-rotation)
- [Recovery](#recovery)

Archivage
---------

[](#archivage)

Let's suppose we have a file named `demo.txt` which we want to archive for 14 days

```
$fileArchiver = new FileArchiver();

...

$filePath = './demo.txt';
$archivedFile = $fileArchiver->archive($filePath, new DateInterval('P14D'));

```

And that's it. Your file is archived in the default storage directory `__DIR__` but you can specify another location is you want

```
$fileArchiver = new FileArchiver('/my/storage/directory');

```

> If you are using Symfony, the default storage location is `%kernel.project_dir%/var/archive/`

Suppression and rotation
------------------------

[](#suppression-and-rotation)

The archive rotation is proceeded each time you archive a file with the same mask.

For exemple let's imagine we archived our file `demo.txt` 2 hours ago for a duration of 1 jour. When we will archive our new file, the previous archived will be deleted because he overlaps his archive duration.

You can anyway clear the archived files the way you want by calling the clear method

```
// This will clear all files having an expired archive duration
$fileArchiver->clear();

// This will clear all files archived before the passed date
// In the exemple below it will clear all archived files
$fileArchiver->clear(new DateTime());

```

Recovery
--------

[](#recovery)

You can recover archived files as below and obtain the list of archived files with the given mask

```
$archivedFilesPath = $fileArchiver->find('demo');

```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity60

Established project with proven stability

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 ~39 days

Total

4

Last Release

1349d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c40cb1e0ff7519a44fcd8438eb3e69ac9d1fe31c855c8ef50966a3c3ad8856c1?d=identicon)[ffcfalcos](/maintainers/ffcfalcos)

---

Tags

symfonyarchivezipfilearchiver

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tbcd-file-archiver/health.svg)

```
[![Health](https://phpackages.com/badges/tbcd-file-archiver/health.svg)](https://phpackages.com/packages/tbcd-file-archiver)
```

###  Alternatives

[nelexa/zip

PhpZip is a php-library for extended work with ZIP-archives. Open, create, update, delete, extract and get info tool. Supports appending to existing ZIP files, WinZip AES encryption, Traditional PKWARE Encryption, BZIP2 compression, external file attributes and ZIP64 extensions. Alternative ZipArchive. It does not require php-zip extension.

4967.4M112](/packages/nelexa-zip)[raulfraile/distill

Smart compressed files extractor

228190.4k9](/packages/raulfraile-distill)[phpzip/phpzip

Package to create and stream archives of compressed files in ZIP format with PHP 5.3+

124840.7k9](/packages/phpzip-phpzip)[mitmelon/compress

Advanced file compresser which reduces and encrypt large files to smaller chunks by saving them as binary for later use.

184.2k](/packages/mitmelon-compress)[jbouzekri/file-uploader-bundle

Aggregate some bundles and libraries to provide easy ajax file upload integration with functionnalities like image croping or storage on amazon

258.1k2](/packages/jbouzekri-file-uploader-bundle)[selective/rar

RAR file reader

2111.1k1](/packages/selective-rar)

PHPackages © 2026

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