PHP code example of cloudatlas / flyclone

1. Go to this page and download the library: Download cloudatlas/flyclone 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/ */

    

cloudatlas / flyclone example snippets


use Verseles\Flyclone\Rclone;
use Verseles\Flyclone\Providers\LocalProvider;

$left_side = new LocalProvider('mydisk'); // nickname
$rclone = new Rclone($left_side);

var_dump($rclone->ls('/home/')); // returns array

use Verseles\Flyclone\Rclone;
use Verseles\Flyclone\Providers\MegaProvider;

$left_side = new MegaProvider('myserver',[
    'user'=>'[email protected]',
    'pass'=> Rclone::obscure('applesux')
]);

$rclone = new Rclone($left_side);

var_dump($rclone->ls('/docs')); // returns array

use Verseles\Flyclone\Rclone;
use Verseles\Flyclone\Providers\LocalProvider;
use Verseles\Flyclone\Providers\MegaProvider;

$left_side = new LocalProvider('mydisk'); // name

$right_side = new MegaProvider('myremote',[
    'user'=>'[email protected]',
    'pass'=> Rclone::obscure('4ppl35u*')
]);

$rclone = new Rclone($left_side, $right_side);

$rclone->copy('/home/appleinc/index.html', '/docs'); // always true, otherwise throws error

use Verseles\Flyclone\Rclone;
use Verseles\Flyclone\Providers\LocalProvider;

$samedisk = new LocalProvider('mydisk'); // name

$rclone = new Rclone($samedisk);

$rclone->copy('/home/appleinc/index.html', '/home/www/'); // always true, otherwise throws error

use Verseles\Flyclone\Rclone;
use Verseles\Flyclone\Providers\LocalProvider;
use Verseles\Flyclone\Providers\DropboxProvider;

$left_side = new LocalProvider('mydisk'); // nickname
$right_side = new DropboxProvider('myremote', [
    'client_id'     => 'your_dropbox_client_id',
    'client_secret' => 'your_dropbox_client_secret',
    'token'         => 'your_dropbox_token',
]);

$rclone = new Rclone($left_side, $right_side);

$rclone->copy('/home/appleinc/index.html', '/home/www/', [], static function ($type, $buffer) use ($rclone) {
   var_dump($rclone->getProgress());
});