Skip to content

wmenge/rsync-lib

 
 

Repository files navigation

rsync-lib

A simple PHP rsync wrapper library

Build Status Scrutinizer Code Quality

Installation

Require it in composer:

composer require albertofem/rsync-lib dev-master

Install it:

composer update albertofem/rsync-lib

If you want to run the tests:

./vendor/bin/phpunit

Usage

Basic usage example:

<?php

use AFM\Rsync\Rsync;

$origin = __DIR__;
$target = "/target/dir/";

$rsync = new Rsync;
$rsync->sync($origin, $target);

Change behaviour:

<?php

use AFM\Rsync\Rsync;

$origin = __DIR__;
$target = "/target/dir";

$config = array(
    'delete_from_target' => true, 
    'ssh' => array(
        'host' => myhost.com, 
        'public_key' => '/my/key.pub'
    )
);

$rsync = new Rsync($config);

// change options programatically
$rsync->setFollowSymlinks(false);

$rsync->sync($origin, $target);

About

A simple PHP rsync wrapper library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%