PHP code example of vashkatsi / folders-sync

1. Go to this page and download the library: Download vashkatsi/folders-sync library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

vashkatsi / folders-sync example snippets




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

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



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 \Vashkatsi\Sync\Client(SECRET, PATH);
$client->run('http://example.com/remote.php'); //connect to server and start sync