https://github.com/secondtruth/synchronizer-files
Synchronize local and remote filesystems
https://github.com/secondtruth/synchronizer-files
php-library synchronizer
Last synced: about 2 months ago
JSON representation
Synchronize local and remote filesystems
- Host: GitHub
- URL: https://github.com/secondtruth/synchronizer-files
- Owner: secondtruth
- License: isc
- Created: 2015-01-01T01:16:50.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2017-09-28T15:01:10.000Z (over 8 years ago)
- Last Synced: 2025-10-04T05:55:53.529Z (4 months ago)
- Topics: php-library, synchronizer
- Language: PHP
- Homepage: http://www.flamecore.org
- Size: 55.7 KB
- Stars: 12
- Watchers: 7
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
FlameCore FilesSynchronizer
===========================
[](https://travis-ci.org/flamecore/synchronizer-files)
[](https://scrutinizer-ci.com/g/flamecore/synchronizer-files)
[](https://scrutinizer-ci.com/g/flamecore/synchronizer-files)
[](http://www.flamecore.org/projects/synchronizer-files)
This library makes it easy to synchronize local and remote filesystems.
FilesSynchronizer was developed as backend for the deployment and testing tool [Seabreeze](https://github.com/flamecore/seabreeze).
It is using our self-developed [Synchronizer](https://github.com/flamecore/synchronizer) library as foundation.
Getting Started
---------------
Include the vendor autoloader and use the classes:
```php
namespace Acme\MyApplication;
use FlameCore\Synchronizer\Files\FilesSynchronizer;
use FlameCore\Synchronizer\Files\Location\LocalFilesLocation;
require 'vendor/autoload.php';
```
Create your `Source` and `Target` objects:
```php
$source = new LocalFilesLocation(['dir' => $sourcePath]);
$target = new LocalFilesLocation(['dir' => $targetPath]);
```
Create the `FilesSynchronizer` and assign the `Source` and the `Target`:
```php
$synchronizer = new FilesSynchronizer($source, $target);
$synchronizer->observe($observer); // optionally set an EventObserver object
```
Now start syncing your files:
```php
$synchronizer->synchronize();
$synchronizer->synchronize(false); // Do not preserve obsolete files
```
Installation
------------
### Install via Composer
[Install Composer](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx) if you don't already have it present on your system.
To install the library, run the following command and you will get the latest development version:
$ php composer.phar require flamecore/synchronizer-files:dev-master
Requirements
------------
* You must have at least PHP version 5.4 installed on your system.
Contributors
------------
If you want to contribute, please see the [CONTRIBUTING](CONTRIBUTING.md) file first.
Thanks to the contributors:
* Christian Neff (secondtruth)