PHPackages                             thadbryson/flysystem-sync - 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. thadbryson/flysystem-sync

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

thadbryson/flysystem-sync
=========================

Flysystem wrapper to sync directories.

v3.0.1(4y ago)28120.8k↓62.2%6[1 issues](https://github.com/thadbryson/flysystem-sync/issues)1MITPHPPHP ^7.2 || ^8.0CI failing

Since Apr 1Pushed 1y ago5 watchersCompare

[ Source](https://github.com/thadbryson/flysystem-sync)[ Packagist](https://packagist.org/packages/thadbryson/flysystem-sync)[ RSS](/packages/thadbryson-flysystem-sync/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (2)Versions (21)Used By (1)

Flysystem Sync
==============

[](#flysystem-sync)

About
-----

[](#about)

This is a wrapper for [Flysystem](https://github.com/thephpleague/flysystem) version 2 and 3. Note that v1.\* is a plugin for Flysystem v1.\*.

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

[](#installation)

Use Composer:

```
"thadbryson/flysystem-sync": ">=2.0"

```

Supports PHP v7.2 and up.

It helps you sync 2 directories at a time. There are two directory types.

Master
------

[](#master)

Contents of this directory are moved to Slave for writing and updating. If this folder has a path that Slave doesn't then the path on Slave is deleted.

Slave
-----

[](#slave)

Target directory. Where things are moved to or deleted from.

How To
======

[](#how-to)

Here is some example code to set everything up.

```
use TCB\FlysystemSync\Sync;

use League\Flysystem\Filesystem;
use League\Flysystem\Local\LocalFilesystemAdapter as Adapter;

// Setup file system.
$master = new Filesystem(new Adapter(__DIR__ . '/sync-test/master'));
$slave  = new Filesystem(new Adapter(__DIR__ . '/sync-test/slave'));

// Create the Sync object. Use root directory. That '/' variable can be any subpath directory.
$sync = new Sync($master, $slave, $config = [], $directory = '/');

// Here is how to actually sync things.

// Add all folders and files ON MASTER and NOT ON SLAVE.
$sync->syncWrites();

// Delete all folders and files NOT ON MASTER and on SLAVE.
$sync->syncDeletes();

// Update all folders and files that are on both MASTER and SLAVE.
$sync->syncUpdates();

// This will do ->syncWrites(), ->syncDeletes(), and ->syncUpdates().
$sync->sync();

// And you can get what all these paths are going to be separately.

$paths = $sync->getUtil()->getWrites();  // On Master but not on Slave.
$paths = $sync->getUtil()->getDeletes(); // On Slave but not on Master.
$paths = $sync->getUtil()->getUpdates(); // On both Master and Slave but with different properties.
```

Example Path Array
==================

[](#example-path-array)

```
array(2) {
    'create-dir/' => \League\Flysystem\DirectoryAttributes,
    'create-dir/3.php' => \League\Flysystem\FileAttributes
}

```

That's an example from a var\_dump() of what a path will give you.

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity42

Moderate usage in the ecosystem

Community20

Small or concentrated contributor base

Maturity77

Established project with proven stability

 Bus Factor1

Top contributor holds 54.5% 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

Every ~326 days

Recently: every ~176 days

Total

11

Last Release

823d ago

Major Versions

v1.1.1 → v2.0.02020-12-23

v2.0.0 → v3.0.02022-04-04

v2.x-dev → v3.x-dev2023-01-31

v3.x-dev → v4.x-dev2024-03-08

PHP version history (2 changes)v2.0.0PHP ^7.2 || ^8.0

v4.x-devPHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/222212?v=4)[Thad Bryson](/maintainers/thadbryson)[@thadbryson](https://github.com/thadbryson)

---

Top Contributors

[![thadbryson](https://avatars.githubusercontent.com/u/222212?v=4)](https://github.com/thadbryson "thadbryson (18 commits)")[![tbryson-dialmycalls](https://avatars.githubusercontent.com/u/220066505?v=4)](https://github.com/tbryson-dialmycalls "tbryson-dialmycalls (10 commits)")[![jorisvaesen](https://avatars.githubusercontent.com/u/4093781?v=4)](https://github.com/jorisvaesen "jorisvaesen (2 commits)")[![goetas](https://avatars.githubusercontent.com/u/776743?v=4)](https://github.com/goetas "goetas (1 commits)")[![kapersoft](https://avatars.githubusercontent.com/u/13007854?v=4)](https://github.com/kapersoft "kapersoft (1 commits)")[![repat](https://avatars.githubusercontent.com/u/516807?v=4)](https://github.com/repat "repat (1 commits)")

---

Tags

filefilesystemflysystemflysystem-pluginphppluginsync

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/thadbryson-flysystem-sync/health.svg)

```
[![Health](https://phpackages.com/badges/thadbryson-flysystem-sync/health.svg)](https://phpackages.com/packages/thadbryson-flysystem-sync)
```

###  Alternatives

[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.7k277.8M952](/packages/league-flysystem-aws-s3-v3)[unisharp/laravel-filemanager

A file upload/editor intended for use with Laravel 5 to 10 and CKEditor / TinyMCE

2.1k3.4M80](/packages/unisharp-laravel-filemanager)[league/flysystem-bundle

Symfony bundle integrating Flysystem into Symfony applications

40131.4M117](/packages/league-flysystem-bundle)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k11](/packages/tempest-framework)[alexusmai/laravel-file-manager

File manager for Laravel

1.2k786.7k9](/packages/alexusmai-laravel-file-manager)[barryvdh/elfinder-flysystem-driver

A Flysystem Driver for elFinder

1864.9M40](/packages/barryvdh-elfinder-flysystem-driver)

PHPackages © 2026

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