Download the PHP package outlandish/sync without Composer
On this page you can find all versions of the php package outlandish/sync. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download outlandish/sync
More information about outlandish/sync
Files in outlandish/sync
Package sync
Short Description Sync directory contents over HTTP using PHP
License MIT
Informations about the package sync
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
If using Composer, add "outlandish/sync":"1.*@dev"
to your requirements.
Otherwise, just download and require
the classes as normal.
How it works
- Client collects list of existing files in destination folder (and subfolders), with size and modified dates
- Client POSTs list to the server
- Server gets list of files in source folder on server and compares this with list of files from client
- Server returns list of new or modified files present on server
- Client requests contents of each new or modified file and saves it to destination folder
- 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
On the server, e.g. example.com/remote.php
:
On the client(s):
FAQ
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.
All versions of sync with dependencies
ext-curl Version *