PHPackages                             outlandish/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. [HTTP &amp; Networking](/categories/http)
4. /
5. outlandish/sync

ActiveLibrary[HTTP &amp; Networking](/categories/http)

outlandish/sync
===============

Sync directory contents over HTTP using PHP

1.0-beta(13y ago)5729413[5 issues](https://github.com/outlandishideas/sync/issues)MITPHPPHP &gt;=5.3.0

Since May 24Pushed 10y ago10 watchersCompare

[ Source](https://github.com/outlandishideas/sync)[ Packagist](https://packagist.org/packages/outlandish/sync)[ RSS](/packages/outlandish-sync/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (2)Used By (0)

Sync directory contents over HTTP using PHP
===========================================

[](#sync-directory-contents-over-http-using-php)

Use these classes to recursively sync the contents of two folders on different servers. The source must have a web server although the directory being synced does not have to be web accessible. The client initiates the connection and can be either another web server or a command line script.

Install
-------

[](#install)

If using Composer, add `"outlandish/sync":"1.*@dev"` to your requirements.

Otherwise, just download and `require` the classes as normal.

How it works
------------

[](#how-it-works)

1. Client collects list of existing files in destination folder (and subfolders), with size and modified dates
2. Client POSTs list to the server
3. Server gets list of files in source folder on server and compares this with list of files from client
4. Server returns list of new or modified files present on server
5. Client requests contents of each new or modified file and saves it to destination folder
6. Client sets last modified time of file to match server

No attempt is made to send diffs; this is not rsync. Symlinks are not explicitly supported. All communication is via JSON data in the request/response body.

Example
-------

[](#example)

On the server, e.g. `example.com/remote.php`:

```
require_once 'vendor/autoload.php'; //or include AbstractSync.php and Server.php

const SECRET = '5ecR3t'; //make this long and complicated
const PATH = '/path/to/source'; //sync all files and folders below this path

$server = new \Outlandish\Sync\Server(SECRET, PATH);
$server->run(); //process the request
```

On the client(s):

```
require_once 'vendor/autoload.php';

const SECRET = '5ecR3t'; //this must match the secret key on the server
const PATH = '/path/to/destination'; //target for files synced from server

$client = new \Outlandish\Sync\Client(SECRET, PATH);
$client->run('http://example.com/remote.php'); //connect to server and start sync
```

FAQ
---

[](#faq)

### Why not just use rsync?

[](#why-not-just-use-rsync)

Sometimes you need code to be portable across a range of hosting environments so you can't rely on rsync, scp or other external dependencies.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

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

4786d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/19558adf77530dd214600f1df79b264fb4976de4d32aa58ac5e2a63a2d5d979b?d=identicon)[kkokkoro](/maintainers/kkokkoro)

![](https://avatars.githubusercontent.com/u/1756944?v=4)[Outlandish](/maintainers/outlandishideas)[@outlandishideas](https://github.com/outlandishideas)

![](https://www.gravatar.com/avatar/31631a25b6c4f3cc8e9afe6217744e8529de467bff9234785eea4eefb1a1ac83?d=identicon)[tamlyn](/maintainers/tamlyn)

---

Top Contributors

[![tamlyn](https://avatars.githubusercontent.com/u/115310?v=4)](https://github.com/tamlyn "tamlyn (8 commits)")[![PeterNotenboom](https://avatars.githubusercontent.com/u/8448364?v=4)](https://github.com/PeterNotenboom "PeterNotenboom (2 commits)")

### Embed Badge

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

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

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25126.1M81](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.2M6.6k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k20.0k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87965.9k113](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.4M85](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69127.2k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

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