PHPackages                             lsv/source-backup-filesystem-compare - 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. lsv/source-backup-filesystem-compare

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

lsv/source-backup-filesystem-compare
====================================

Compare a source filesystem, with a backup filesystem

07PHPCI failing

Since Oct 3Pushed 6y ago1 watchersCompare

[ Source](https://github.com/lsv/source-backup-filesystem-compare)[ Packagist](https://packagist.org/packages/lsv/source-backup-filesystem-compare)[ RSS](/packages/lsv-source-backup-filesystem-compare/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Compare a source filesystem, with a backup filesystem
-----------------------------------------------------

[](#compare-a-source-filesystem-with-a-backup-filesystem)

It will look for every file on the source filesystem, and report if the file is missing on the backup filesystem, and if it exists, it will report if the backup file is newer/older or has a different size than the source file.

#### Install

[](#install)

```
composer require lsv/source-backup-filesystem-compare

```

#### Usage

[](#usage)

First we need to create a source filesystem and a backup filesystem.

We are using [league/flysystem](https://flysystem.thephpleague.com/docs/) so we can use many different storages

```
use League\Flysystem\Filesystem;
use Lsv\BackupCompareFilesystems\CompareFilesystems;

// For adapters see the league/flysystem docs
$source = new Filesystem($sourceAdapter);
$backup = new Filesystem($backupAdapter);

foreach ((new CompareFilesystems($backup, $source))->compare() as $file) {
    // Now $file are a Lsv\Lsv\BackupCompareFilesystems\Model object
    if ($errors = $file->getErrors()) {
        foreach ($errors as $error) {
            echo $error; // $error is a integer which corresponts to the following constants
            // 1 = \Lsv\BackupCompareFilesystems\Model::SOURCE_FILE_DOES_NOT_EXISTS_IN_BACKUP
            // 2 = \Lsv\BackupCompareFilesystems\Model::SOURCE_FILE_IS_SMALLER_THAN_BACKUP
            // 3 = \Lsv\BackupCompareFilesystems\Model::SOURCE_FILE_IS_BIGGER_THAN_BACKUP
            // 4 = \Lsv\BackupCompareFilesystems\Model::SOURCE_FILE_IS_OLDER_THAN_BACUP
            // 5 = \Lsv\BackupCompareFilesystems\Model::SOURCE_FILE_IS_NEWER_THAN_BACKUP
        }
    } else {
        echo 'Backup file is matching the source file';
        // Source file is matching the backup file
    }
}
```

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 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.

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/lsv-source-backup-filesystem-compare/health.svg)

```
[![Health](https://phpackages.com/badges/lsv-source-backup-filesystem-compare/health.svg)](https://phpackages.com/packages/lsv-source-backup-filesystem-compare)
```

###  Alternatives

[phmlabs/annovent

Simple lightweight event dispatcher using annotations for registering listeners

113.3k](/packages/phmlabs-annovent)

PHPackages © 2026

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